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.

 

SobiPro - First Check Section ID - then check type - then set display.

SobiPro - First Check Section ID - then check type - then set display.

I have a sobi-pro site with 2 sections.

The first has a section id of 54
The second has a section id of 6778

I want to have 2 featured entries modules - 1 for each section.

I want each module to display in the section and category pages but not the entry pages.

I understand how to test for the view type but I am stuck on getting the section ID first.

Thanks

datatonic
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: SobiPro - First Check Section ID - then check type - then set display.

Hi,

It took a while but I have an answer for you.

Try the following code:

Code:

if (class_exists('SPFactory')) {

  $section = SPFactory::currentSection();
  if ($section) {
    try {
      $ob = SPFactory::object( SPRequest::sid() );
      $type = $ob->oType;
      /* now test for different types. You can test for "entry",
         "section" or "category". */
      if ($type == 'section' or $type == 'category') {
        $section_id = $section->get("id");
        if ($section_id == 54) return XXX;
        if ($section_id == 6778) return YYY;
        // replace XXX and YYY with the module ids to use for those 2 sections.
      }
    } catch ( SPException $x ) {}
  }
}

Edited By: metamodguy
10-Jul-14 13:44:07

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
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11538
Newest User:
michael2155
Members Online:
3
Guests Online:
230


Forum Legend:

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