Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » SobiPro - First Check Section ID -...
Page:
1
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
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 14:44:07
10-Jul-14 14:44:07
Administrator has disabled public posting
Page:
1
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » SobiPro - First Check Section ID -...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 169
- 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