PDA

View Full Version : شرطی کردن یک قالب



++Hichkas
یک شنبه 16 تیر 1392, 01:12 صبح
با سلام خدمت همه دوستان
من در حال طراحی یه قالب جوملا هستم که میخوام شرطیش کنم
یعنی بگم اگر تو یک موقعیت اگر هیچ ماژولی فعال نیست اون موقعیت رو نشون نده و مقدار فضاش رو بین موقعیتهای هم ردیفش تقسیم کن اما تو تقسیم کردن فضا گیر کردم
میشه کمک کنین بگین چطور باید شرطش رو بنویسم؟؟ من تا الان اینطوری نوشتم اما ایراد داره درست کار نمیکنه

<?php if ($this->countmodules('left')||($this->countmodules('slider'))||($this->countmodules('right'))) {?>

<div id="left"> <jdoc:include type="modules" name="left" style="xhtml" /> </div><div id="slider" > <jdoc:include type="modules" name="slider" style="xhtml" /></div>
<?php } else { ?>
<div id="left-L"> <jdoc:include type="modules" name="left" style="xhtml" /></div> <div id="slider-L" > <jdoc:include type="modules" name="slider" style="xhtml" /> </div>
<?php } ?>




بد جور گیر کردم خواهشا کمکم کنین :گریه:

فرزند کوروش
یک شنبه 16 تیر 1392, 08:32 صبح
width ای دی left-L رو بزرگ تر کن باید مشکلت حل بشه. اگر شرط هات درست کار نمیکنه شاید به این دلیل باشه


$this->countmodules('right')
این موقعیت توی دایوهات موجود نیست !

++Hichkas
چهارشنبه 26 تیر 1392, 01:38 صبح
سلام ممنون از جوابتون
حالا یه سوال البته ببخشین اگر مبتدی هستش این شرط بنظرتون درسته؟؟
چطور میتونم بهینه اش کنم؟؟
<?php if (($this->countmodules('left')) &&($this->countmodules('slider'))&& ($this->countmodules('right'))) {?>
<div id="container11"><div id="left"><jdoc:include type="modules" name="left" style="xhtml" /></div><div id="slider"><jdoc:include type="modules" name="slider" style="xhtml" /></div><div id="right"> <jdoc:include type="modules" name="right" style="xhtml" /></div> </div>
<?php } else if (($this->countmodules('left')) && ($this->countmodules('right'))){ ?>
<div id="container111111"><div id="left"><jdoc:include type="modules" name="left" style="xhtml" /></div> <div id="right"><jdoc:include type="modules" name="right" style="xhtml" /> </div></div>
<?php }else if ($this->countmodules('left')) { ?>
<div id="container111"><div id="left"><jdoc:include type="modules" name="left" style="xhtml" /></div> <div id="slider"><jdoc:include type="modules" name="slider" style="xhtml" /> </div></div>
<?php } else if ($this->countmodules('right')) { ?>
<div id="container1111"><div id="right"><jdoc:include type="modules" name="right" style="xhtml" /></div><div id="slider"> <jdoc:include type="modules" name="slider" style="xhtml" /></div></div>
<?php } else { ?>
<div id="container11111"><div id="slider"><jdoc:include type="modules" name="slider" style="xhtml"/></div></div>
<?php } ?>