Here it is from the editlink_edit_center.tpl of mollio-beat:
Code:
<ul id="category" class="column-list">
{section name=thecat loop=$cat_array}
{if $cat_array[thecat].spacercount lt $lastspacer}{$cat_array[thecat].spacerdiff|repeat_count:'</ul>'}{/if}
{if $cat_array[thecat].spacercount gt $lastspacer}<ul class="column-list">{/if}
<li>{$cat_array[thecat].spacercount|repeat_count:' '}
<input name="category" type="radio" id="select-i" value="{$cat_array[thecat].auto_id}"
{if $cat_array[thecat].auto_id eq $submit_category} checked{/if}/>
{$cat_array[thecat].name}
</li>
{assign var=lastspacer value=$cat_array[thecat].spacercount}
{/section}
</ul>
The code when rendered is a mess - why are nonbreaking spaces being used for layout? Visually, the categories and sub categories are a list within a list, and the code really should reflect that.
What it should look like is this - excuse the pseudo code:
Code:
<ul>
<li>Parent category
<ul>
<li>Sub category</li>
<li>Sub category</li>
</ul>
</li>
<li>Next Parent category
<ul>
<li>more sub cats</li>
<li>and even more</li>
</ul>
</li>
</ul>
Secondly, I dont want users to be able to submit stories into the top level categories. That is what the sub cats are for.
If I could get some help with the above code, I think I could figure that out myself, but at the moment the above is too hard for me to unpick.
For example, what are spacercount, $lastspacer and repeat_count? I know that something in there is adding 2 nonbreaking spaces for each level of the category (2 for top level, 4 for next etc), but I can't figure out what to change to remove the radio button for the top level.
If anyone can help me with this, it'd be greatly appreciated.





Linear Mode

