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.

 

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

gol135
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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

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

Re: Display a particular joomla Banner for a article not linked to menu

Thanks for your help and great module! smile
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

gol135
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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

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:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11584
Newest User:
allen6221
Members Online:
0
Guests Online:
189

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