Home page modules showing on articles in Joomla

2019-04-28 07:55发布

问题:

I have custom HTML & other modules on homepage which have been marked to display only on homepage. I also have articles on homepage with "read more" links.

Problem is that when I click on these read more links page opens with all the homepage modules still there and article is displayed below these modules.

I have checked setting all the modules are marked to display just on homepage, yet they get displayed on articles pages too.

Please help.

回答1:

Those articles become "children" of the page you are viewing, so that's why you see the modules there.

I had that problem before, it's related to Itemid I guess.

You can use Advanced module manager to assign those modules ONLY to the homepage.

EDIT:

Manual solution without using the AMM extension.



回答2:

you MUST publish the category that your articles belong to in ANY joomla menu so that those articles get their own item id because they are children of that category. this is a default Joomla behavior since 1.5



回答3:

Every article needs to have a menu item or a parent menu item, IIRC, and if it doesn't find one, its parent menu item is the default menu item (the front page menu item).

So to fix this, you need to make sure that every category has a corresponding menu item, so that every article's parent menu item is not the home page. This works because every article has a category ("uncategorized" counts as a category).

Create a hidden menu, and then create one "Articles » Category List" menu item for each category.

You can find more documentation in the wiki page entitled How to control module display when linking to an article with no menu item.



回答4:

Here is an explanation of the joomla item id problem and a fix

http://www.joomlabamboo.com/blog/tutorials/how-to-avoid-the-joomla-menu-itemid-issue

When articles do not have a menu item they show the modules assigned to the page they were linked from, in the same way if you had a blog category menu item you would expect any blogs under that menu item to show the modules assigned to the parent without having to assign them to each and every post. This is a big problem when you have a homepage which hides the component output as any further items just show the homepage with a different url.



回答5:

I had the same problem, and installing the Advance Module Manager (AMM) did solve my problem. All I had to do was go to the specific modules that I had chosen to display on the home page (Based on the standard Joomla settings), then under the "module assignments" options of each module there were new settings (From AMM) that had a section for "Home page", I chose the setting "Include" (Default is "ignore") on each of the modules.

What this "include" does, is that it ensures that only the homepage (your true default directory, rather than the Joomla article chosen as "feature/homepage") is the one that features the modules chosen, and not children articles, or others (which was my problem)



回答6:

I had the similar problem and found this article to be a great point to start: How to control module display when linking to an article with no menu item

It works for J 2.5 and 3x Personally I used the Metamod extension to control Joomla modules display. It requiers a little bit of code understanding, but greatly helps when you figure out...



回答7:

I used the follwing php snippet in my custom Joomla 3.3 template:

if (
$_SERVER['REQUEST_URI'] == '/' or
$_SERVER['REQUEST_URI'] == '/index.php' or
$_SERVER['REQUEST_URI'] == '/home.html') { 
echo 'homepage html' 
} else { 
echo 'non-homepage html' }


回答8:

I had this same problem with the modules such as "most popular" and "recently added" and the problem was solved when I checked out the language of the articles and changed the ALL to ENGLISH, or FINNISH etc. After that, everything worked like I wanted to. Hope this will help you too..



标签: joomla