Hi Everyone, This question has to do with both PHP and HTML so I am posting it in PHP forum. I was able to install PHPLD V2, modify and do some minor changes in no time just by going thro' the docs. I am stuck up at the template design part, however. Here is the link to my PHPLD directory. As you can see there are two main categories Internet and Software that are displayed in a single column. I want these categories to be displayed in a single row (and two columns) instead. I went inside main.tpl file under templates and located this code which I believe is controlling the table behaviour: <table border="0" cellpadding="0" cellspacing="30"> <tr> {foreach from=$categs item=cat name=categs} {if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td>{/if} <h2><a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{else}index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h2> {* Display subcategories *} {if !empty($cat.SUBCATS)} <p class="subcats"> {foreach from=$cat.SUBCATS item=scat name=scategs} <a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{$scat.TITLE_URL|escape}/{else}index.php?c={$scat.ID}{/if}"> {$scat.TITLE|escape}</a> {/foreach} </p> {/if} {if ($smarty.foreach.categs.iteration mod $cats_per_col eq 0 and $cats_per_col gt 1) or $smarty.foreach.categs.last}</td>{/if} {/foreach} </tr> </table> PHP: I did a lot of hit-and-try but was not able to reach at my desired solution. Probably I am missing something there... Can someone please help? Let me know if you need more info. Thanks!
I downloaded the script so will have a look. Did you mess with line $smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1 Code (markup): to see what happens
Yes I did. I removed $smarty.foreach.categs.iteration mod $cats_per_col eq 1 and PHP: but to no avail.
i added a <td> after this line {foreach from=$categs item=cat name=categs} Code (markup): to make <table border="0" cellpadding="0" cellspacing="30"> <tr> {foreach from=$categs item=cat name=categs} <td> {if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td>{/if} <h2><a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{else}index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h2> Code (markup): but this puts them all on one line
That did it. i won't have too many categories so this is fine for me... I wonder , How come I didn't think this Anyways, Thanks Valdor. +repped