• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: 3 unterschiedliche Klassen für Tabellenspalten [gelöst]
PostPosted: Mon Oct 24, 2011 5:13 pm 
Offline
Forum Members
Forum Members

Joined: Sat Jan 10, 2009 2:44 pm
Posts: 58
Location: Asperg
Hallo,

ich habe das Menu-Manager-Template so umgeschrieben, dass ich anstatt einer List eine Tabelle bekomme (was dazu dient, dass ich so alle Spalten automatisch gleich breit machen kann).
Der ausgegebene HTML-Code sieht also folgendermaßen aus:
Code:
<table width="920" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
          <tr>
            <td><a href="#">Home</a></td>
            <td><a href="#">News</a></td>
            <td><a href="#">Team</a></td>
            <td><a href="#">Forum</a></td>
            <td><a href="#">Clanwars</a></td>
            <td><a href="#">Media</a></td>
            <td><a href="#">Kontakt</a></td>
          </tr>
        </table>


Das Menu-Manager-Template ist folgendes:
Code:
{if $count > 0}
<table width="920" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
  <tr>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<tr>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</td></tr>" times=$node->prevdepth-$node->depth}
</td>
{elseif $node->index > 0}</td>
{/if}

{if $node->current == true}
<td><a href="{$node->url}" class="current"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
<td class="activeparent"> <a href="{$node->url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{else}
<td><a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{/if}

{/foreach}

{repeat string="</td></tr>" times=$node->depth-1}</td>
</tr>
</table>
{/if}


Meine Frage ist nun: Wie kann ich mit Smarty den <td>-Tags oder den <a>-Tags immer 3 verschiedene Klassen nach einander zuweisen?
Das sollte dann ungefähr so aussehen:
Code:
<table width="920" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
          <tr>
            <td><a href="#" class="s1">Home</a></td>
            <td><a href="#" class="s2">News</a></td>
            <td><a href="#" class="s3">Team</a></td>
            <td><a href="#" class="s1">Forum</a></td>
            <td><a href="#" class="s2">Clanwars</a></td>
            <td><a href="#" class="s3">Media</a></td>
            <td><a href="#" class="s1">Kontakt</a></td>
          </tr>
        </table>


Gruß,
Markus


Last edited by wilderpel on Tue Nov 01, 2011 1:17 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: 3 unterschiedliche Klassen für Tabellenspalten
PostPosted: Mon Oct 24, 2011 8:26 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Tue Aug 12, 2008 9:30 pm
Posts: 2071
Location: Feldkirchen in Kärnten, Austria
Theoretisch ginge es wohl mit cycle
class="{cycle values='s1,s2,s3'}"

_________________
CMSMS Blog - I do this!
Forge profile
Github profile
Twitter
=============================================
Support CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: 3 unterschiedliche Klassen für Tabellenspalten
PostPosted: Tue Nov 01, 2011 1:16 pm 
Offline
Forum Members
Forum Members

Joined: Sat Jan 10, 2009 2:44 pm
Posts: 58
Location: Asperg
danke, das funktioniert :)


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting