0

Following scenario:

i published 2 separate main menu items: "Home" & "News"

  • for "home": i got a category blog published as homepage menu item showing the latest 3 articles tagged as category "news", and some other modules around it
  • for "news" this is also a category blog but with a list of all news intros without any other modules
  • in general the news are published as intro & detail article, thus showing on the homepage only an intro image and intro text

The issue is now, that when a website visitor clicks the homepage news teaser, then the detail news opens and in the menu the "home" remains active. But I'd want that the menu item is "news".

The same issue applies if a detail news article is opened from the category blog in "news", then unfortunately also "home" is set active.

Is there any workaround for this scenario? So that I can control that always a specific main menu item is active if the detail page of a category blog is opened?

I'm already using the Advanced Module Manager joomla extensions, but this only helps to hide / control modules aroud a categeory blog, but does not help to modify behavior of the category blog detail page mechanism or URL handling.

Thank you for your help. Andre

1
  • Can't tell from this if there is a menu item for the news detail page. Is there more than one? Less?
    – Arlen
    Commented Aug 15, 2019 at 14:02

2 Answers 2

0

I can see your problem - and did not notice this behaviour before.

I don't know an easy setup change - but i can think of a 'quick and dirty' solution using a system plugin, set the active menu in the 'OnBeforeRender' function using the note field of the article... like this:

public function OnBeforeRender() {
    $app = JFactory::getApplication();
    $article_id=$app->input->get('id');
    $article =JTable::getInstance("content");
    $article->load($article_id);
    $note = $article->get('note');
    $menu = $app->getMenu();
    $menu->setActive($note);
}

HTH - Martin - write me if you need more help with the plugin

1
  • A more friendly approach would be to simply create a custom field for the article and use that. That way the field even has a label and tooltip that will properly explain what it's for.
    – Arlen
    Commented Aug 15, 2019 at 14:59
0

You can use a module to present article intros from a category on the home page, and publish the articles in blog view as a component on the News page. Cliking the read-more link from the home page located article intro will lead youy to the complete article on your News page in this set-up.

There are loads of more specialised modules you can find on the Joomla Extension Directory that give you all sorts of possibilities as to ways of presentation for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.