Hello
I am designing a new theme for s9y. How do I change the xml feed icon automatically for the different color versions of the theme? Images for different colors are stored in different sub-directories of the templatename/img/ directory. Will I have to use php to copy the relevant image into the img/ dir or can I do this using the style sheet? If I have to copy the image using php (coupled with smarty) then can I assume that the template directory is writeable?
If I allow users of s9y 1.1 to change template colors using the admin UI then does it make the theme incompatible for use with older versions of s9y?
In the technical document "configuration of theme options" section "smarty way" the path to the stylesheets does not allow for a non-standard templates directory path. How do I insert the relevant stylesheet link allowing for custom template paths? In other words is there a .tpl file tag equivalent to {TEMPLATE_PATH} ?
Thanks
Changing xml feed icon via template
-
- Regular
- Posts: 117
- Joined: Fri Apr 21, 2006 10:11 pm
- Location: Karachi, Pakistan
- Contact:
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Changing xml feed icon via template
Hi!
Actually, this is not easily possible with the current syndication plugin, because that does not support templating.
What you could do is to emit a different CSS for the color theme version that styles the XML.gif image per color:
So you'd disable the usual IMG emitted by the HTML and override it with a CSS declaration.
Best regards,
Garvin
Actually, this is not easily possible with the current syndication plugin, because that does not support templating.
What you could do is to emit a different CSS for the color theme version that styles the XML.gif image per color:
Code: Select all
/* RED.css */
.serendipity_syndication_plugin img {
display: none;
}
.serendipity_syndication_plugin a {
background-image: url(path/to/red_xml.gif);
background-repeat: no-repeat;
}
Yes, you can use {serendipity_getFile} to check for a file in your template path!In other words is there a .tpl file tag equivalent to {TEMPLATE_PATH} ?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 117
- Joined: Fri Apr 21, 2006 10:11 pm
- Location: Karachi, Pakistan
- Contact:
Garvin how do I change the xml feed icon for the categories? In this case the icon has a seperate link. Trying to do this with the following css does not work:
Are themes created for s9y1.1 compatible with older s9y versions? Doesn't serendipity_getFile intrepret {TEMPLATE_PATH} in style sheets?
Code: Select all
.container_serendipity_categories_plugin .serendipitySideBarContent a img
{
display:none;
}
.container_serendipity_categories_plugin .serendipitySideBarContent a {
background-image:url("{TEMPLATE_PATH}img/green/xml.gif");
background-position:top left;
background-repeat:no-repeat;
display:inline;
}
Abdussamad
Serendipity templates
Serendipity templates
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Hm, that CSS should work. Do you have the URL where this code is so that I can look at it?
You can use {$template} to get the name of the template that is currently active, though. So you could use
for example. But this would then not check other template directories like "default" to search for an image, like the getfile function would do!
Best regards,
Garvin
Hm, that CSS should work. Do you have the URL where this code is so that I can look at it?
Yes! S9y top goal is compatibility. The getFile smarty function has been in since the first smarty serendipity version, so you can use it everywhere.Are themes created for s9y1.1 compatible with older s9y versions? Doesn't serendipity_getFile intrepret {TEMPLATE_PATH} in style sheets?
You can use {$template} to get the name of the template that is currently active, though. So you could use
Code: Select all
<img src="{$serendipityBaseURL}templates/{$template}/img/icon.gif" />
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 117
- Joined: Fri Apr 21, 2006 10:11 pm
- Location: Karachi, Pakistan
- Contact:
I figured out how to style the xml icon. First I have to set the categories plugin to accept smarty templating then add a space inside the xml icon link like so
This and some futzing arround with the css got it to work.
Secondly, you know how we use {TEMPLATE_PATH} in the CSS stylesheet styles.css and s9y replaces this with the appropriate path before presenting it to the browser. Can this be done in stylesheets other than the default styles.css? That is stylesheets included based on user selected theme options in the admin interface.
Code: Select all
<a class="serendipity_xml_icon" href="{$plugin_category.feedCategoryURL}"> <img src="{$category_image}" alt="XML" style="border: 0px" /></a>
Just to make sure, I was referring to making a theme whose colors or other options can be changed using the administrator interface (not getfile ). Is such a theme compatible with pre s9y 1.1 versions?Yes! S9y top goal is compatibility. The getFile smarty function has been in since the first smarty serendipity version, so you can use it everywhere.
Secondly, you know how we use {TEMPLATE_PATH} in the CSS stylesheet styles.css and s9y replaces this with the appropriate path before presenting it to the browser. Can this be done in stylesheets other than the default styles.css? That is stylesheets included based on user selected theme options in the admin interface.
Abdussamad
Serendipity templates
Serendipity templates
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Since smarty is pretty forgiving about unsert variables for foreach and other calls, this shouldn't be a problem, yes.
However, if you include your CSS from your template file in the .tpl file via:
then you will be able to use url(../img/icon.gif) calls in your CSS. CSS calls take their relative URL from the directory they were called in, so you can use relative links there easily.
Best regards,
Garvin
Ah, okay, I misunderstood that. Yes, such a theme would be backward compatible, if your template uses the theme option variable array so that it falls back to some output if an array / value is not existing.Just to make sure, I was referring to making a theme whose colors or other options can be changed using the administrator interface (not getfile ). Is such a theme compatible with pre s9y 1.1 versions?
Since smarty is pretty forgiving about unsert variables for foreach and other calls, this shouldn't be a problem, yes.
No - TEMPLATE_PATH is replaced using the serendipity.css.php script. If you emit your custom CSS files, the template path cannot be replaced because that CSS is not looped through PHP.Secondly, you know how we use {TEMPLATE_PATH} in the CSS stylesheet styles.css and s9y replaces this with the appropriate path before presenting it to the browser. Can this be done in stylesheets other than the default styles.css? That is stylesheets included based on user selected theme options in the admin interface.
However, if you include your CSS from your template file in the .tpl file via:
Code: Select all
<link rel="stylesheet" src="{$serendipityBaseURL}templates/{$template/css/custom.css" />
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 117
- Joined: Fri Apr 21, 2006 10:11 pm
- Location: Karachi, Pakistan
- Contact:
I'm doing something similar to what abdussamad is doing, so first of all thanks for saving me some work ![Smile :)](./images/smilies/icon_smile.gif)
I was wondering whether I have a full list of all plugins/features actually using the xml icon. You guys have mentioned categories and feeds in this thread, I know that freetag can use the xml icon, too.
Any other plugin left to cover?
![Smile :)](./images/smilies/icon_smile.gif)
I was wondering whether I have a full list of all plugins/features actually using the xml icon. You guys have mentioned categories and feeds in this thread, I know that freetag can use the xml icon, too.
Any other plugin left to cover?