Support Forum
Hello,
I recently found a problem with the Recent Posts widget from the Template Tags plugin.
The problem occurs when I try to enter HTML code in the form for "Before Forum Text:", "Before Topic Text:", "Before User Text:", etc. etc. What I'm trying to do is to enclose the actual label texts inside a span with their own class declarations so I can format those labels separately using CSS. In the example below, I typed the following entries in each of the succeeding "Before" entry fields:
<span class="fp-spwidget-forum-text">Forum:</span>
<span class="fp-spwidget-topic-text">Topic:</span>
<span class="fp-spwidget-user-text">By:</span>
<span class="fp-spwidget-date-text"> - </span>
The problem occurs when I save my input. While the text I entered is saved (confirmed by loading the website which showed the expected result), the widget seems to remove part of what I inputted once it refreshes after saving (see screen caps below) and part of the input I entered becomes part of the widget's parameter entry form and messes up its display. Worse, if I save that again the text saved is what's left in the input box so in effect the original contents are replaced even if no edit to them actually took place.
From what I can see, it appears that the presence of double quotes (") in the entry fields messes up how the widget reads the entered values.
The screen caps are below: the first one is before I pressed "Save" while the second one is after I pressed "Save".
I don't think I've ever looked into the recent posts widget to deeply, so I might be wrong but it looks to me like you're not going to be able to do it that way due to the fact that it's essentially putting HTML / CSS inside PHP - The double quotes are going to cause problems as well as other syntax.
If you want to make those kind of changes, you'll need to add the function directly to a text widget inside PHP tags. Check out the Recent Posts Template Tag page - You can add the function to the widget in the same way you would add a function to a template (see SP templates for examples if you're not sure) and It gives you arguments you can use to give each element it's own class so you can style individually.
Hi Ike,
I understand I can use the template tags equivalent, but I think that should at least be considered a bug if the widget accepts and saves the input (which it does, because I verified that what I type in got through) but cannot effectively re-display what it accepted. I also tried inputting some more variations of some text and saw that anything after "class=" is what gets cut off when the widget refreshes in the Appearance>Widget menu.
I tried doing something similar to the widget title area and got no errors. Which means that it is done correctly in another field which does something very similar within the same widget.
This is quite similar to an old bug (apparently already fixed with the latest version) in a previous version of SP that's still on my production server (SP v.5.3.4) -- that's where the "Allowed WP shortcodes in posts:" field in Options>Content Settings would incorrectly display the list of shortcodes that were correctly inputted. The original input would be one line per shortcode but when you reload that forum admin page it'll show all shortcodes you entered on one line with each shortcode delimited by the letter 'n'. I'm guessing that somewhere the '
' that was saved as input got converted to 'n' when redisplayed.
I will open a ticket to get it looked at and see if there is a problem... It should work with html - even our defaults include html... but possible a wrong filter is used on display in admin...
Visit Cruise Talk Central and Mr Papa's World
looks like there is a display vs edit filter issue here... will get it fixed up in the next version... if goes well, might be able to get it out this weekend...
Visit Cruise Talk Central and Mr Papa's World
just need to see if I can complete testing on it... Andy is on vacation for another week or so, which means a bit short handed around here...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)