Hallo,
ich benötige 2 verschiedene Akkordion Templates, da diese ja nicht ausgewählt werden können wollte ich das wie folgt lösen:
PHP-Code:
<?php if(in_array('Klasse', explode(' ', $this->class))): ?>
geändertes Template
<?php else: ?>
default Template
<?php endif; ?>
dadurch habe ich folgendes gemacht
Template: moo_accordion.html5
PHP-Code:
<?php if(in_array('accord_close', explode(' ', $this->class))): ?>
<script>
....
display: -1;
.....
</script>
<?php else: ?>
hier ist der Eintrag display: -1; nicht vorhanden
<?php endif; ?>
Template: mod_comment_form.html5 mit Akkordion-Funktion
PHP-Code:
<?php if (!$this->requireLogin): ?>
<section class="<?php echo $this->class; ?> ce_accordion ce_text block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<!-- indexer::stop -->
<div class="toggler"<?php if ($this->headlineStyle): ?> style="<?php echo $this->headlineStyle; ?>"<?php endif; ?>>
<h3>Kommentieren</h3></div>
<div class="accordion"><div>
<div class="form">
<?php if ($this->confirm): ?>
<p class="confirm"><?php echo $this->confirm; ?></p>
<?php elseif ($this->allowComments): ?>
<form<?php if ($this->action): ?> action="<?php echo $this->action; ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="post">
<div class="formbody">
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>">
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
<div class="widget">
<?php echo $this->fields['name']->generateWithError(); ?> <?php echo $this->fields['name']->generateLabel(); ?>
</div>
<!-- no E-Mail & Website
<div class="widget">
<php echo $this->fields['email']->generateWithError(); ?> <php echo $this->fields['email']->generateLabel(); >
</div>
<div class="widget">
<php echo $this->fields['website']->generateWithError(); ?> <php echo $this->fields['website']->generateLabel(); ?>
</div>
-->
<?php if (isset($this->fields['captcha'])): ?>
<div class="widget">
<?php echo $this->fields['captcha']->generateWithError(); ?> <label for="ctrl_captcha"><?php echo $this->fields['captcha']->generateQuestion(); ?><span class="mandatory">*</span></label>
</div>
<?php endif; ?>
<div class="widget">
<?php echo $this->fields['comment']->generateWithError(); ?> <label for="ctrl_<?php echo $this->fields['comment']->id; ?>" class="invisible"><?php echo $this->fields['comment']->label; ?></label>
</div>
<!-- no notify
<div class="widget">
<php echo $this->fields['notify']->generateWithError(); ?>
</div>
-->
<div class="submit_container">
<input type="submit" class="submit" value="<?php echo $this->submit; ?>">
</div>
</div>
</form>
<?php endif; ?>
</div>
<!-- indexer::continue -->
</div></div>
</section>
<?php endif; ?>
Egal wo ich jetzt die Klasse, welche ich im moo_accordion template festgelget habe hinzufüge, funktioniert das nicht. (Ich weiß das es in dem Code momentan nirgendswo steht)
Wenn ich das display -1 in den "else" Teil packe, sind die Akkordion geschlossen, also funktioniert das prinzipiell
Also jetzt die Frage, wo trage ich die 'Klasse'
PHP-Code:
<?php if(in_array('Klasse', explode(' ', $this->class))): ?>
geändertes Template
<?php else: ?>
default Template
<?php endif; ?>
ein damit das funktioniert bzw angesprochen wird.
Lesezeichen