Page 1 of 2
We need help changing the feed icon
Posted: Wed Mar 07, 2007 8:59 am
by yellowled
I figure almost anybody except the people involved in it have given up trying to follow
http://board.s9y.org/viewtopic.php?t=8579 from the themes forum. In short, we're trying to build a new, almost unbreakable code framwork for templates, and we're pretty much there, but now we need some help from the coder ranks.
We're trying to find sort of a 'holy grail' in s9y template design: we'd love to be able to change the feed icon displayed by sidebar plugins like syndication, categories, and freetag (those are the important, if not only ones) to let different colorsets of the same theme have individual feed icons. Our latest template jedi padawan, Owen Stubbs/Don, has come up with
great code to do this via .tpl files which seems like the only sane way to do this. I know Abdussamad has come up with a solution to do the same thing using CSS only, but that technique doesn't work for the freetag plugin.
We don't need help with the smarty code, that's already in the drawer. However, here's the problem: Both the syndication and freetag plugin don't
have .tpl files. So here's the big question: is it possible to update those two plugins to use .tpl files? I'm willing to help with the .tpl files, but my PHP is almost non-existent, so I don't understand the code for the plugins in question. Truth be told, I can't even
find the code for the syndication plugin
I figure we're asking for something which may seem negligible that involves some work, but I assure you, this would really take s9y themes to a new level. Plus, we're never gonna ask for anything from the coder guys again! (Kidding, I can't promise that

)
I can't estimate how much of a hassle this would be, but it's definitely not urgent. We got a lot of bughunting left for that template framework, so anyone willing to address this may take some time. Thanks in advance.
YL
Re: We need help changing the feed icon
Posted: Wed Mar 07, 2007 12:52 pm
by garvinhicking
Hi!
We don't need help with the smarty code, that's already in the drawer. However, here's the problem: Both the syndication and freetag plugin don't
have .tpl files. So here's the big question: is it possible to update those two plugins to use .tpl files? I'm willing to help with the .tpl files, but my PHP is almost non-existent, so I don't understand the code for the plugins in question. Truth be told, I can't even
find the code for the syndication plugin
It would be possible, but I don't like that. The important core plugins should never use Smarty templating (see the categories plugin, it also doesn'T use smarty tpls by default), because of the preformance impacts.
Both plugins (freetag and syndication) are so minor, that adding tpl parsing to them would impact the load time of the plugin by 300-400%.
Just for the benefit of a different XML icon depending on a template option is IMHO not worth it.
Isn't there maybe some CSS magic that can change <img> files to be different?
Most of the plugins simply use a single xml.gif file in templates, and I must say I see no way to change that in a way that would be senseful.
HTH,
Garvin
Re: We need help changing the feed icon
Posted: Wed Mar 07, 2007 10:41 pm
by yellowled
garvinhicking wrote:Just for the benefit of a different XML icon depending on a template option is IMHO not worth it.
Isn't there maybe some CSS magic that can change <img> files to be different?
You're probably right.
There is a technique which Adussamad used for one of his themes, but it doesn't work with the freetag plugin for whatever reason.
I guess we're gonna give CSS one last shot, and if nobody can come up with a consistent technique, people will simply have to switch feed icons themselves.
YL
Posted: Thu Mar 08, 2007 3:46 am
by judebert
They may not be templated, but if CSS isn't working, it's probably because we're missing a class on the file. I'm sure Garvin wouldn't mind us adding or changing a class in the plugin.
Or, how about adding an option to the plugin configuration? I realize it's an extra step, and not necessarily intuitive, but it's better than templating.
Posted: Thu Mar 08, 2007 1:07 pm
by yellowled
judebert wrote:They may not be templated, but if CSS isn't working, it's probably because we're missing a class on the file. I'm sure Garvin wouldn't mind us adding or changing a class in the plugin.
I'm gonna take a look at Abdussamad's code again trying to find out why it doesn't work for the freetag plugin. After that, I'll hopefully be able to say more.
YL
Posted: Thu Mar 08, 2007 2:18 pm
by yellowled
Hohum. I'm a little bit embarrassed, but I have to admit: Abdussammad's code
does work with the freetag plugin - it just needed some extra twitching
However, I'm still not 100% sure it works perfectly, in any browser etc. (But then again, we're never 100% sure about that.) Plus, I still don't know if we got every plugin using that darned feed icon covered now.
However, only your answers in this thread have made me turn to that again, so this was a good thing anyway

Thanks and sorry about the fuss, guys.
YL
Posted: Thu Mar 08, 2007 2:44 pm
by garvinhicking
Hi!
However, I'm still not 100% sure it works perfectly, in any browser etc. (But then again, we're never 100% sure about that.) Plus, I still don't know if we got every plugin using that darned feed icon covered now.
You could download the full spartacus plugin snapshot via netmirrorg.org and search on all files for "xml.gif":
./serendipity_event_freetag/serendipity_event_freetag.php
./serendipity_event_mycalendar/serendipity_plugin_mycalendar.php
syndication plugin
categories plugin
authors plugin
HTH,
Garvin
Posted: Thu Mar 08, 2007 4:41 pm
by yellowled
garvinhicking wrote:You could download the full spartacus plugin snapshot via netmirrorg.org and search on all files for "xml.gif"
Why should I do that if you've already done it for me?

I'm gonna double check that, I actually do have a rather recent snapshot of every plugin by coincidence.
Anyway, freetag, syndication, and categories are already covered. Freetag was a bit tricky, so I figure the rest of them can't be that hard ...
Thanks again.
YL
Posted: Thu Mar 08, 2007 6:06 pm
by Don Chambers
This is painfully simple if Garvin would be willing to change the syndication and freetag plugins with a tiny, tiny change.
The category plugin uses the following:
Code: Select all
<a class="serendipity_xml_icon" href="{$plugin_category.feedCategoryURL}"><img src="{$category_image}" alt="XML" style="border: 0px" /></a>
Since the anchor has the class "serendipity_xml_icon", the CSS is a breeze:
Code: Select all
.serendipity_xml_icon {
background:url('img/whatever_xml_icon_you_want.gif') 0 0 no-repeat;
visibility: visible;}
.serendipity_xml_icon img {
visibility:hidden;}
The syndication plugin, currently, has no assigned classes. The freetag plugin assigns a class to the image. Both of these methods are problematic.
If Garvin would simply change the 2 plugins to emit the class "serendipity_xml_icon ON THE ANCHOR, just like categories plugins, we are done - and I don't see this change messing up any templates from the past.
Posted: Thu Mar 08, 2007 6:33 pm
by yellowled
Owen Stubbs wrote:This is painfully simple if Garvin would be willing to change the syndication and freetag plugins with a tiny, tiny change.
It isn't necessary, it works without changes. See bulletproof thread in themes forum
YL
Posted: Thu Mar 08, 2007 6:55 pm
by Don Chambers
YellowLed wrote:Owen Stubbs wrote:This is painfully simple if Garvin would be willing to change the syndication and freetag plugins with a tiny, tiny change.
It isn't necessary, it works without changes. See bulletproof thread in themes forum

YL
I think we should keep this conversation on this thread. The method you are using works in FF, but does not work at all in IE6 for syndication and freetag. According to your observation, it does not work in < IE 6 either.
You also mentioned the My Calendar and Author plugins that use the feed icon, so if these remaining 4 (syndication, freetag, my calendar & author) can emit the class serendipity_xml_icon on the anchor, we can use the very simple css I posted above... at least, I think it will work!

Posted: Fri Mar 09, 2007 10:05 am
by garvinhicking
Hi!
I've added those. But keep in mind that they will only be avaliable then for people using serendipity 1.2 and the latest freetag/myauthors plugin.
Best regards,
Garvin
Posted: Fri Mar 09, 2007 10:45 am
by yellowled
Owen Stubbs wrote:The method you are using works in FF, but does not work at all in IE6 for syndication and freetag. According to your observation, it does not work in < IE 6 either.
I was aware it doesn't work for syndication (and authors, for that matter), because it uses :first-child, which isn't interpreted by IE <= 6. Can't really see why it shouldn't work for freetag.
Owen Stubbs wrote:You also mentioned the My Calendar and Author plugins that use the feed icon, so if these remaining 4 (syndication, freetag, my calendar & author) can emit the class serendipity_xml_icon on the anchor
Categories, too. Of course this would be easier, but I wanted to spare Garvin having to add code if it wasn't really necessary. Plus ...
garvinhicking wrote:But keep in mind that they will only be avaliable then for people using serendipity 1.2 and the latest freetag/myauthors plugin.
Of course we hope that users will always use the latest stable s9y and keep their plugins updated. Problem is: the record shows, some of them don't

On the other hand I don't think we're responsible for people using a template which obviously won't work with their installation.
Plus, this either keeps us from releasing bulletproof before s9y 1.2 is released (which isn't too bad, we have a lot of bughunting etc. to do) or makes us maintain two to three versions of it, which I really don't want to do.
YL
Posted: Fri Mar 09, 2007 3:17 pm
by Don Chambers
garvinhicking wrote:Hi!
I've added those. But keep in mind that they will only be avaliable then for people using serendipity 1.2 and the latest freetag/myauthors plugin.
Best regards,
Garvin
Thankt for the update Garvin. If all you did was update the 4 plugins, why would it not work with 19y 1.1? Syndication might be a core plugin, and that one I could understand, but how about the others?
Also, is there some way to display a message for the user to the effect of "requires version # of XXXXXXXX plugin if they are not using the most current version, perhaps on the manage styles page when they are choosing other template options?
Posted: Fri Mar 09, 2007 3:40 pm
by garvinhicking
Hi!
Thankt for the update Garvin. If all you did was update the 4 plugins, why would it not work with 19y 1.1? Syndication might be a core plugin, and that one I could understand, but how about the others?
Because the syndication and authors plugin are internal plugins that are only shipped with s9y core distros and are not available singularly
Also, is there some way to display a message for the user to the effect of "requires version # of XXXXXXXX plugin if they are not using the most current version, perhaps on the manage styles page when they are choosing other template options?
You could do that with extensive config.inc.php magic, but I don't think it's worth the effort and impact on config.inc.php filesize
Best regards,
Garvin