Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Integrate Metamod with Mosets Tree...
Integrate Metamod with Mosets Tree and iJoomla Ad Agency
Integrate Metamod with Mosets Tree and iJoomla Ad Agency
Hi-- new user here. I am looking for some suggestions on recipes for displaying Ad Agency Zone Module Ads in specific Mosets Tree categories. We have somewhere around 250 categories in Tree. The site is EncoreDirectory.com.
So far we have this code:
if ($option == 'com_mtree' and JRequest::getVar('task') == 'viewlink') {
$link = JRequest::getInt('link_id',0);
$query = "select cat_id from #__mt_cats where link_id = $link;";
$db->setQuery( $query, 0, 1 );
$row = $db->loadObject();
$cat_id = @$row->cat_id;
echo "welcome to";
echo $cat_id;
echo $link;
}
Which is giving some results, by displaying our one test ad, in each listing. It seems to fail on one listing http://www.encoredirectory.com/index.ph … els-talent as it is adding a second module to the innertop position, next to the ad zone.
I found this code in another forum thread:
if ( JRequest::getVar('url') == 'search-results' ) {
$brand = strtolower(JRequest::getVar('jr_brand'));
switch ($brand) {
case "canon": return 351;
case "fujitsu": return 352;
case "hp": return 353;
// add more as appropriate
}
}
What would you suggest for the proper/best way to do this. I should point out I really don't understand this code, so I am relying on copy/paste and trial and error. Thanks!
--Grace McKay
Re: Integrate Metamod with Mosets Tree and iJoomla Ad Agency
Hi Grace,
a few things to note:
1 - it appears that your template is adding the extra module next to the one created "on the fly" by MetaMod. I guess it's doing that to fill up that space. It's likely that if you were to assign a normal module into the same place where the MetaMod is, the same thing would happen -- there would be a blank module next to it. I would suggest that you make another suitable module to put into that space so that the space is filled up appropriately.
2 - the 2 blocks of PHP you are using above work in different ways. The first creates some HTML code ("welcome to ...") and puts this into the module. The second example takes a pre-existing module and places it into (inside) the MetaMod, depending on some conditions. So you really need to decide what it is you want. Do you want to just place some dynamic HTML? If so, you can use the 1st approach to create it and put it into place. Do you want to use the MetaMod to decide which one of a group of modules you want to display, based on the category of the link? If so, use a combination of the 1st and 2nd approach. From the 1st, use the database query that determines the category, then from the 2nd, use that to pull in a pre-existing module suitable for that category of link.
That's what I'd do, anyway!
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Integrate Metamod with Mosets Tree...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8026
- Newest User:
- rivas48750
- Members Online:
- 0
- Guests Online:
- 193
- 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