Home page modules showing on articles in Joomla

2019-04-28 07:45发布

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.

标签: joomla
8条回答
劳资没心,怎么记你
2楼-- · 2019-04-28 08:27

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.

查看更多
一夜七次
3楼-- · 2019-04-28 08:29

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

查看更多
我想做一个坏孩纸
4楼-- · 2019-04-28 08:29

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...

查看更多
走好不送
5楼-- · 2019-04-28 08:30

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.

查看更多
做个烂人
6楼-- · 2019-04-28 08:32

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..

查看更多
地球回转人心会变
7楼-- · 2019-04-28 08:35

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' }
查看更多
登录 后发表回答