PDA

View Full Version : Is there a way to define a default image...


damic
01-27-2009, 08:17 PM
Is there a way to define a default image to use in certain categories/sub categories? I mean - that if someone doesn't choose/upload and image - can I set what would be automatically used instead?

What I'm trying to do is to keep each cat/sub cat looking about the same with the Summaries - so each would have an image box... but just wondering if there is another way I can code the summary tpls to reflect a default image in maybe an "else" statement.

Thanks-

krcko
01-27-2009, 08:33 PM
well you gave answer for your own question :)

you can easly check if an article has image assigned or not with an if statement, and if not, you can provide your own image with else element:

<vte:if test="{article.image}">
...
<vte:else>
<img src="path/to/your/default/image.png" width=".." height="..." alt="..." />
</vte:else>
</vte:if>

damic
01-27-2009, 08:41 PM
that's what I thought... I do my best not to seem like a complete idiot you know :)

However... I'm guessing this would mean that I would have to setup seperate summary/default.tpl and summary/vertical.tpl files for EACH cat/subcat that I would want to assign default images to?