othellotech Posted April 23, 2007 Share Posted April 23, 2007 What with template systems in general, and smarty in particular, being a PITA to work with, I'm having an "interesting" time with adjusting step two of the orderform regarding free domains. Despite coding the $freedomaintlds section to be in a fixed width table, the list of TLDs is about 55 screens wide, not 400 pixels ... {if $freedomaintlds} <table width="400" align="center" border="1"> <tr><th>* [i]{$LANG.orderfreedomainregistration} {$LANG.orderfreedomainappliesto}: [/i]</th></tr> <tr><td>[i]{$freedomaintlds}[/i]</td></tr> </table> {/if} Is ignoring the table width and making it 100% of the required width for the content - one day someone will invent a computer that actualy does what its bloody-well-told-to-do ! Anyway, what I actually want is to control how many tlds on each line, or to check if every tld is there and output a different message etc. So in *theory* ... {$freetlds = explode(",", $freedomaintlds)} {foreach $freetlds as $freetld} $freetld - {/foreach} should output each of the tlds one at a time with " - " between them - which would be a start. Sadly no output at all. Its the foreach it cant cope with, and I've been staring at it way too long to be able to spot wood-from-trees and see the error, so any pointers much appreciated 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted March 25, 2009 Author Share Posted March 25, 2009 with many thanks to Matt @ WHMCS ... {if $freedomaintlds} * <em>{$LANG.orderfreedomainregistration} {$LANG.orderfreedomainappliesto}</em> <table> <tr> {php} $freedomaintlds = $this->_tpl_vars["freedomaintlds"]; $freedomaintlds = explode(",",$freedomaintlds); $freedomaintldsbreakat = 13; foreach($freedomaintlds as $key=>$value) { if ($freedomaintldscounter % $freedomaintldsbreakat == 0) { echo "</tr><tr>"; } $freedomaintldscounter++; echo "<td>$value</td>"; } {/php} </tr> </table> {/if} displays them neatly in a table 13 cells wide - adjust to suit goes in steptwo and configureproducdomain - just look for the freedomaintlds part 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.