stuffedhippo Posted June 21, 2011 Share Posted June 21, 2011 I hope someone can help me. On my site I have set features for each product and need to show these in a styled table. This requires me to input the specific features in and table cell without using the {foreach} as this just repeats everything in the table. This is what I have so far: >{foreach from=$features item=feature} </pre> <table width="560" border="0">AIRFRAMEYear of Manufacture{if $feature.name|escape:'htmlall':'UTF-8' == '01 Year of Manufacture'} {$feature.value|escape:'htmlall':'UTF-8'} {/if} Time Since New{if $feature.name|escape:'htmlall':'UTF-8' == '02 Time Since New'} {$feature.value|escape:'htmlall':'UTF-8'} {/if} Landings{if $feature.name|escape:'htmlall':'UTF-8' == '03 Landings'} {$feature.value|escape:'htmlall':'UTF-8'} {/if} </table> <br>{/foreach This just duplicates the table and puts the feature in. As you can imagine I don't want to duplicate the table.Thanks Link to comment Share on other sites More sharing options...
stuffedhippo Posted June 22, 2011 Author Share Posted June 22, 2011 All sorted. Found out the features use an array so put this in my product.tpl file: {$features|print_r} This then returns the array number that each of my features are in. Then just put each of these features using the relevant numbers, like so: {$features.0.value} into my table so no need for the foreach tag Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now