I have a custom field which is radio buttons with two options - App or Web.
In the template I want to display one image if the entry is App and a different image if it’s Web.
Is there any way to do this? I’ve searched the docs but with no success.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 04, 2010 6:24pm
Subscribe [3]#1 / Aug 04, 2010 6:24pm
I have a custom field which is radio buttons with two options - App or Web.
In the template I want to display one image if the entry is App and a different image if it’s Web.
Is there any way to do this? I’ve searched the docs but with no success.
#2 / Aug 20, 2010 5:55pm
You should be able to do this:
{if custom_field="App"}
app_image.ext
{if:elseif custom_field="Web"}
web_image.exp
{/if}#3 / Aug 26, 2010 4:16pm
Or if it’s an icon that’s not content, more for display - you could have a CSS class for each that places the correct icon. Then in your template add the class from the custom field:
<div class="{custom_field}">
... content for each entry ...
</div>You can then create different styles for both:
.app {
background: url(app-icon.gif) no-repeat left top;
}
.web {
background: url(web-icon.gif) no-repeat left top;
}