2

A typical scenario I believe every Joomla users have encountered is: You have a module on the article list page(like Category Blog), but you don't want this module to also show on the article content page. However, since the article page inherits itemid of the blog page, the module will also show on it. According to Joomla's documentation, you can create hidden menu items for each article to avoid this, but I really don't like this approach, for two reasons:

1)It is a painful toil if I have hundres of articles; 2)The breadcrumb would be homepage>article instead of homepage>category>article

I think this has been bugging Joomla users since 1.5, now that joomla 3.8.2 is out, has there been better approach to solve this problem? I know "Module anywhere" but do I still have to rely on 3rd party extension to solve this simple issue? If yes, no wonder Wordpress is more prevailing.

2
  • This may not be possible in Joomla by the core module manager by default, but there are many ways it can be achieved - and easy ways. Either by using extensions, or modifying your template, or even using modules that may have such functionality buil-in. And since you mentioned WP, I don't think Wordpress is doing any better in its core on this. I would say it's widgets system is even poorer compared to the module capabilities.
    – FFrewin
    Dec 13, 2017 at 13:07
  • I have opened a feature request for J4.x here: github.com/joomla/joomla-cms/issues/19723 Feb 18, 2018 at 19:09

3 Answers 3

2

You can do this using Regular Lab's Advanced Module Manager.

Install it and activate it, and select the following for the the module settings:

For Assigments use Joomla! Content, include pagetype, selection category Blog.

This will give you the module only on the category blog page, but not on the seperate article-view pages.

Success!

1

Joomla 3.8.2 does not add any solution to your issue.

One solution you didn't mention would be to use CSS to hide the unwanted modules on article layout pages.

Pros: It's easy to implement and, depending on how your template sets its class variables, highly configurable.

Cons: The hidden modules are still having to be build/rendered by joomla and added to the DOM even though they wont be seen/used. Yuck.


Allow me to respectfully give an opinion here in response to your Joomla criticisms:

It might seem like no-brainer to add to the core for you but I've never had a need for such functionality and I've been using Joomla since the 1.5 days. So I don't know if this is really as big of a missing feature as you might suspect.

To that point, what's wrong with installing the 3rd party extension solution? For installations of both Joomla and Wordpress there are multiple 3rd party extensions that I install on just about every instance of both CMS systems. I wouldn't say Wordpress is any better in that regard. It seems like standard operating practice for both CMS's (and I assume Drupal is the same way).

1

This can be resolved at the template level (which is the cleanest way of doing this) as described here.

Essentially, you will need to modify your template's index.php file to include a condition to check if the current view is not an article view, and then add the module tag if that's the case. Here's an example condition (note: the condition in the blog post linked to is different, but both should work):

$option = JFactory::getApplication()->input->getCmd('option');
$view   = JFactory::getApplication()->input->getCmd('view');
if ($option == 'com_content' && $view == 'category'){
    //add the module tag
}

This method is the most stable method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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