Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
requests-topic
Template tag that allows for passing of blog link text.
Avatar
Kadin
Rookie
Free Members
sp_UserOfflineSmall Offline
Sep 10, 2010 - 11:52 am

I am currently using the sf_blog_linked_tag(); template tag to replace the default comments link on my homepage. The value for the text of that link is defined in the Blog Linking -> Link Display Text section of the forum admin. I tried defining that field as something similar to the following:

%ICON% sf_comments_number($no_comment="Leave a comment", $one_comment="One comment", $many_comment="% comments", $blogcomments=false);

And I also tried:

%ICON% <?php sf_comments_number($no_comment="Leave a comment", $one_comment="One comment", $many_comment="% comments", $blogcomments=false); ?>

But neither seemed to work so I'm assuming that they are getting filtered out (html only).

Now I saw this template tag: sf_first_topic_post_link($blogpostid, $linktext); And tried inserting something like the following into my homepage template (%post-id% being the ID of the blog post):

<?php sf_first_topic_post_link(%post-id%, sf_comments_number($no_comment="Leave a comment", $one_comment="One comment", $many_comment="% comments", $blogcomments=false)); ?>

But it does not seem to create a link unless the topic has at least one post associated with it.

So what I'm really asking for is a sf_blog_linked_tag(); that I can pass a $linktext to just like the sf_first_topic_post_link(); tag.  That or make a sf_first_topic_post_link(); that will link to the primary topic instead of the first post.  Either option would work I guess, probably the latter would be better as it would not require the fix we had to work out from my previous problem.  In any case this is a very minor superficial change but one that I think would be cool to have.  As always thank you for your time and keep up the awesome work!Laugh

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 10, 2010 - 9:07 pm

sorry, such a tag does not exist... you will have to create one yourself...  but afraid its not a minor change as the template tag uses a common routine that uses the link display text on the components panel (as you have noticed)...

perhaps an alternate route you could go is to add a filter to the standard output...  in sf-links-support.php, routine sf_transform_bloglink_label() you could change

$text = sf_filter_title_display($sfpostlinking['sflinkblogtext']);

to

$text = apply_filters('sfh_link_text', sf_filter_title_display($sfpostlinking['sflinkblogtext']));

and then add a standard wp filter to change the text to what you want.. of course, you will need to check that its one you actually want to change (ie on the front page)...

not sure what you mean by 'primary topic instead of first post'?????

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625