Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Widget
Avatar
Marc Stadelmann
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2015 - 5:24 am

Hi,

I bought the template "Tags and Widgets". Is there a way to display the post instead of a tip? Which file do I need to modify in order to configure this widget?

Thanks,

Marc

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2015 - 5:47 am

Hey Marc,

Not really sure I'm following you there, could you explain a bit more?

Also, have you taken a look at the Codex page for the Tags Plugin, and also the Widget page to see if it explains what you are looking to achieve?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 15, 2015 - 5:57 am

I think the question means displaying the actual post content in each entry rather than just showing a truncated, html-stripped version as a tooltip. Is that right?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Marc Stadelmann
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2015 - 9:12 am

Hi,

Yellow Swordfish is right.

I read the codex and my question concerns the option "show post extract as popup tooltip". Is there a way to have a "P" option to display the Post content in the widget instead of a tooltip displayed with the mouse?

Thanks,

Marc

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 15, 2015 - 9:19 am

Not as it stands at the moment but we would be open to changing that.

The main problem from a technical point of view is the nature of the post content. It is stored in pure HTML format with all html tags in place. It can contain image tags and links, video tags and much formatting like bold and colours etc. And it can be of an indeterminate length. So it could be huge!

The current 'post tip' is sanitised of the HTML and truncated to a sensible length. This could be displayed in the widget/template tag with some minor enhancements to the tag code. But if you wanted the entire post intact with all html, then you are looking at a more major development, an unknown and uncontrolled display requirement and some concerns abut how it would actually be displayed. For example - images? Do they get included?

So - what was it you were looking for?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Marc Stadelmann
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2015 - 9:38 am

I understand. I was not thinking of the whole post. Maybe just a few words (minor enhancement). Is there a way to update it myself as I bought the template?

Another question: when we set an icon for a forum, can we display it instead of its name ("F" option)?

Thanks,

Marc

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 15, 2015 - 1:55 pm

just about anything is possible with the api in place for simple press...    but both are significant departures from the provided widget - essentially a large effort...

maybe you just want the tooltip output as an excerpt...  the widget uses the list topic class and the post content itself is not available...  it can be added via code mod or using the api, but again, not just a couple lines of code...

the post content is provided to the list post class which is used by some other template tags in the plugin you are using - namely, latest posts and newest topics... but neither of them output that post content as part of the standard display...

why do none expose the post content?  largely because no one has asked for it... real estate is usually at a premium and outputting content takes up quite a bit of space, even if an excerpt... and then there is the issue (as Andy said) about what html to output and how it will look (remember, the forum css wont be available to the widget)...

are you able to do any coding? we can try to guide you through some of the modifications if you want... 

and we do have a custom plugin service if you wanted to go down that route...

Avatar
Marc Stadelmann
Rookie
Free Members
sp_UserOfflineSmall Offline
Aug 16, 2015 - 4:11 am

Thanks Mr Papa

I do have some coding skills but I don't want to invest a large effort in it. I'll find a way with your excellent plugin.

Thanks again

Marc

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 16, 2015 - 4:56 am

If it is any help, the recent posts widget uses the code at /wp-content/sp-resources/forum-plugins/template-tags/library/sp-RecentPosts-tag.php

If you scroll down that function to the comment '# start the loop' , then you will see how it is built. The current post content as shown in the tooltip IS defined in the data object as $spThisListTopic->post_tip so this could be used as part of the main display as opposed to as a tooltip. Shown after the topic link perhaps... so for example:

case 'T':
    # Topic
    $out.= $beforeTopic;
    if ($tLink) $out.= "<a class='$linkClass' $title href='$spThisListTopic->post_permalink'>";
    $out.= sp_truncate($spThisListTopic->topic_name, $truncate);
    if ($tLink) $out.= '</a>';
    $out.= $afterTopic;
    $out.= $spThisListTopic->post_tip.'... ';
    break;

Of course - you would not be able to update the tags plugin without losing the change.

andy-signature.png
YELLOW
SWORDFISH
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: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626