Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Hide modules on Sobipro details page

Hide modules on Sobipro details page

Hey guys,

I am desperately trying to hide Metamod module only on Sobipro detail pages.
So, I do not want to show any modules on Sobipro details page, so that the details page is full width.

I already created a new module position "right-mid-metamod", and assigned all modules in Sobipro pages to that. I assigned the position "right-mid-metamod" in Metamod to pull modules, and gave Metamod module position of "right-mid".

Now I need the PHP code to hide Metamod only on details page of Sobipro.

I found these two bits of code on the forum, but have no idea how to fit them together. I need to get better versed in PHP, I know...

Code:


if ($option == "com_sobipro") try {
$ob = SPFactory::object( SPRequest::sid() );
$type = $ob->oType;
/* now test for different types. You can test for "entry",
  "section" or "category". */
if ($type == "entry") return 121;
}

catch ( SPException $x ) {}

Code:

if ($option == "com_sobipro"

  and $Itemid == 266
  and JRequest::getVar("sid") == 54
  and JRequest::getVar("lang") == "en"
) return XXX;

If you could please help me to customize the code...

Thank you for your help and thank you for your work!

Rich

richstrauss
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide modules on Sobipro details page

Hi Rich,

I'd just use a variant of the 1st alternative. That's because the URL parameters references in the 2nd alternative don't actually make a distinction between the 3 types of pages (entry, section and category).

So, try this:

Code:

if ($option == "com_sobipro") try { 

$ob = SPFactory::object( SPRequest::sid() );
$type = $ob->oType;
/* now test for different types. You can test for "entry",
  "section" or "category". */
if ($type == "entry") return;// return nothing for "entry" pages
}

catch ( SPException $x ) {}
return "right-mid-metamod"; // for everything else, pull in these modules.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hide modules on Sobipro details page

Thank you Stephen! Pretty awesome.

The module position does not collapse however. Will I need to get Metamod Pro to make that happen?

Awesome forum. You are very helpful.

Rich

richstrauss
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide modules on Sobipro details page

Yes, the Pro version will allow it to collapse.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: Hide modules on Sobipro details page

Purchased and installed. Works like a charm. Thank you!

richstrauss
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide modules on Sobipro details page

You're welcome :-)

"If you use MetaMod, please post a rating and a review at the Joomla! Extensions Directory"

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4384
Newest User:
rash39381
Members Online:
0
Guests Online:
200

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked