Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Display a particular joomla Banner...
Display a particular joomla Banner for a article not linked to menu
Display a particular joomla Banner for a article not linked to menu
Hi, hope you can help please?
Using Joomla 2.5, Metamod v3.14
My articles are not linked to a menu, but are sorted in categories. They are linked to by module, listing the articles with a link to each article.
I would like to display a particular joomla banner module when one of these links for a specific article link is clicked on.
I tried this recipe:
detect
$module_to_return = 167;
if ( $option == 'com_resource'
and $view == 'article'
) {
$article_id = JRequest::getVar('article');
if ( $article_id == 264
) return $module_to_return;
}
But the banner module I would like to have displaying does not display when I click on a particular article...nothing happens.
Can you help please?
Thanks
Re: Display a particular joomla Banner for a article not linked to menu
Hi, I think the PHP code you took is from Mighty Resources rather than from standard Joomla articles.
Try something like this:
if ($core_genius->check("pagetype = article")) {
$a = $content_genius->info("article_id");
if ($a == 264) return 167;
if ($a == 265) return 168;
if ($a == 266) return 539;
if ($a == 267) return 212;
// etc. Just add more lines as appropriate, checking for
// the article id and returning the module id.
// And don't forget the following line at the end:
}
Hope that helps,
Stephen
Re: Display a particular joomla Banner for a article not linked to menu
Thanks for your help and great module!
another question- is it possible to return three or for modules as separate modules per article. This is just to follow the styling of the template.
I have managed to return them using this code:
if ($a == 264) return "167,171,172,30";
but it groups all modules within in one module.
Is there another way?
Thank you
Re: Display a particular joomla Banner for a article not linked to menu
Hi,
the easiest way is to go Pro -- that will output all the modules as separate modules, just as if they were assigned to the page individually.
You may however be able to get similar results by working with the "Style for included modules" or "Style override for included modules", and/or "Module class suffix" in Advanced Options.
I'd try the module class suffix first: try putting something like "foo". This can often trick your CSS into not recognising the outer MetaMod module HTML wrapping as being a module, so then it recognises the "inner" modules as proper modules. If that doesn't work, try the different styles in the "Style for included modules" and see if that works any better.
If you're good with CSS, using the Module Class Suffix and writing a CSS rule to effectively ignore the MetaMod's wrapping HTML can work depending on the complexity of your template.
Or just go pro and save yourself the hassle!
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Display a particular joomla Banner...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 0
- Guests Online:
- 176
- 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