0
Welcome Guest! Login
0 items Join Now

Conditional module display

    • Jossi's Avatar
    • Jossi
    • Rocketeer
    • Posts: 83
    • Thanks: 0

    Conditional module display

    Posted 16 years 2 weeks ago
    • I am using the HiveMind template and need to conditionally not display certain modules when in the frontpage.

      Is there a way to get the current page name or id (or better: to get a variable that tells me that we are displaying the frontpage) so that I can add some php if blocks and accomplish this?
    • -- Jossi
      Jossi's blog
    • Jossi's Avatar
    • Jossi
    • Rocketeer
    • Posts: 83
    • Thanks: 0

    Re: Conditional module display

    Posted 16 years 2 weeks ago
    • Probably this would work:
      <?php $menu = &JSite::getMenu(); ?>
      <?php if ($menu->getActive() == $menu->getDefault()) { ?>
            //we are in the frontpage
      <?php } else { ?>
           //not on the frontpage
      <?php } ?>
    • -- Jossi
      Jossi's blog
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: Conditional module display

    Posted 16 years 2 weeks ago
    • hi jossi,

      i am not 100% sure i understand what you're after, but can't you just use the menu assignment settings in the module parameters to have each module published or not published on the frontpage?

      kat :)
    • Kat05 / QA Lead & Support / Germany
    • Jossi's Avatar
    • Jossi
    • Rocketeer
    • Posts: 83
    • Thanks: 0

    Re: Conditional module display

    Posted 16 years 2 weeks ago
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: Conditional module display

    Posted 16 years 2 weeks ago
    • nice, glad i could help! :)
    • Kat05 / QA Lead & Support / Germany

Time to create page: 0.084 seconds