Elxis CMS Forum

Support => General => Topic started by: ROUBOS on May 07, 2014, 12:55:59

Title: Hide part of layout when on certain page??? [SOLVED]
Post by: ROUBOS on May 07, 2014, 12:55:59
Hi,
I want to hide the right column of my layout, when on a certain autonomous page, in order to give that page more width.

I have done this for a component with the following code
Code: [Select]
<?php if ($option != 'com_eforum') { ?>

      <div id="leftcoln">

           </div>

   <?php }?>

and I have also been showing how to change the id of part of my layout
Code: [Select]
<?php  if ($option == 'com_eforum') {?>
      <div id="maincolnforum">
   <?php } else {?>
       <div id="maincoln">
   <?php }?>

So how do I do it for a certain page?
Do I use the page url like so? :
Code: [Select]
<?php if ($option != 'our-cars.html) { ?>
thanks
Title: Re: Hide part of layout when on certain page???
Post by: datahell on May 07, 2014, 13:56:35
In Elxis 4.x you just check the existance and value of ELXIS_ARTID constant.

if (defined('ELXIS_ARTID') && (ELXIS_ARTID == 15)) {
    //We are on article page with id = 15
}

In Elxis 2009.x you have to work with the variables $option, $task and $id

global $option, $task;
if (($option == 'com_content') && ($task == 'view')) {
      $id = (int)mosGetParam($_REQUEST, 'id', 0);
      if ($id == 15) {
             //We are on article page with id = 15
      }
}
Title: Re: Hide part of layout when on certain page???
Post by: ROUBOS on May 07, 2014, 17:31:10
that works
 (Elxis 2009.x)

but how about the home page?

I dont want it to display a certain <div> when the id is of a certain page, and it works, but it also does not show it on the home page.

why?
Title: Re: Hide part of layout when on certain page???
Post by: datahell on May 07, 2014, 18:51:21
Frontpage has option = com_frontpage, and no other parameters
Title: Re: Hide part of layout when on certain page???
Post by: ROUBOS on May 07, 2014, 22:18:06
thanks a lot.
that fixed it :)