flexibles Spaltenlayout
- nicolafw
-
Autor
- Neues Mitglied
-
Weniger
Mehr
30 Mai 2012 12:21 #34665
von nicolafw
flexibles Spaltenlayout wurde erstellt von nicolafw
ich habe ein flexibles Spaltenlayout nach
software-lupe.de/sl-tutorials/422-cms/41...body-bereich-content
eingerichtet und es klappt auch fast. Nur wenn mehrere Module in der rechten Splaten sind ignoriert er die Breite und gibt nicht ide richtige Klasse aus:
www.quantica-capital.com/joomla_25/
template/index.php ganz oben in der Datei:
template/index.php im body:
template/css/template.css:
Ich habe keine Ahnung von PHP aber wahrscheinlich liegts am countModules('right') == 1. Es müsste wohl ein grösser-gleich-Zeichen dort rein, oder?
www.quantica-capital.com/joomla_25/
template/index.php ganz oben in der Datei:
Code:
<?php
defined( '_JEXEC' ) or die;
JHTML::_('behavior.framework', true);
$app = JFactory::getApplication();
if($this->countModules('right') == 0) $contentwidth = "1";
if($this->countModules('right') == 1) $contentwidth = "2";
?>
template/index.php im body:
Code:
<div id="content" class="col_<?php echo $contentwidth; ?>">
<jdoc:include type="message" />
<jdoc:include type="modules" name="debug" />
<jdoc:include type="component" />
</div>
<?php if($this->countModules('right')) : ?>
<div id="sidebar">
<jdoc:include type="modules" name="right" style="xhtml" />
</div>
<?php endif; ?>
template/css/template.css:
Code:
.col_2 {
width:552px;
}
.col_1 {
width:820px;
}
Ich habe keine Ahnung von PHP aber wahrscheinlich liegts am countModules('right') == 1. Es müsste wohl ein grösser-gleich-Zeichen dort rein, oder?
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- nicolafw
-
Autor
- Neues Mitglied
-
Weniger
Mehr
30 Mai 2012 13:22 #34670
von nicolafw
nicolafw antwortete auf Aw: flexibles Spaltenlayout
Damit hat es geklappt, hab einfach mal rumprobiert:
if($this->countModules('right') == 0) $contentwidth = "1";
if($this->countModules('right') >= 1) $contentwidth = "2";
if($this->countModules('right') == 0) $contentwidth = "1";
if($this->countModules('right') >= 1) $contentwidth = "2";
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Moderatoren: Tribal6, RePao, Dragonlord, Chris Hoefliger, pascale, adiheutschi.ch