Module appears on every page even if it shouldn't

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Sun May 02, 2021 6:45 pm

Hey!


I have a question regarding a Joomla-website I'm building for the elementary school of my children.

Here is the URL:

https://www.tuttmannschule-essen.de/beta/ts001_START

I've set the Homepage (named START) as a category blog page.
01 Bildschirmfoto 2021-05-01 um 21.32.07.png
On the same START-page I placed two more module

- "Kalender" (showing a Google-calendar) that should only appear on START and
- "KommunikationsZeile" (showing the contact informations in the footer) that should appear on every single page.
02 Napkin 01.05.21, 9.48.28 PM.png
It's the first module - "Kalender" - that gives me headaches!
As I said above it should only appear on the START-page:
03 Bildschirmfoto 2021-05-01 um 21.33.20.png
However every time I click on one of the articles from the category showed on the START-page the "Kalender"-module appears as well underneath the article:
04 Bildschirmfoto 2021-05-01 um 21.35.31.png
What I would like is to see only the article I clicked on (that's "Beitrag Nr.1" above) but not every time also the "Kalender"-module.

Could you please give me a hint what do I do wrong here?

Thanks in advance!


Regards,
Vlad
You do not have the required permissions to view the files attached to this post.

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 6765
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Module appears on every page even if it shouldn't

Post by AMurray » Sun May 02, 2021 9:34 pm

OK I see what you mean, the links for each of the blog articles on the Start page opens with the calendar in the foot but you don't want the calendar on every page.

I think what you could do is create menu items for each (make them "hidden" (so they don't display on a menu)) and then turn the module off, for those particular menu items in the usual way (in the module containing the google calendar). That would be the way I do it but there might be something more efficient especially if you have lots of articles
Regards - A Murray

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 1:43 pm

> OK I see what you mean, the links for each of the blog articles on the Start page opens with the calendar in the foot but you don't want the calendar on every page.

Yes, that's exactly what it drives me crazy! ;-)


> I think what you could do is create menu items for each (make them "hidden" (so they don't display on a menu)) and then turn the module off, for those particular menu items in the usual way (in the module containing the google calendar).

I also thought about this and I already did this: If you click on the menu "Neuigkeiten" (the next right to the START) it would show the category-blog (just like the "START" but whitout the calendar).
Bildschirmfoto 2021-05-03 um 15.22.22 - opt.png
However this doesn't seem to solve the problem: Even when clicking on the articles within the page "Neuigkeiten" they show up… with the calendar in the foot! :-(
In the meantime the module "Kalendar" should also NOT appear on "*Neuigkeiten*":
Bildschirmfoto 2021-05-03 um 15.23.50 - opt.png

> That would be the way I do it but there might be something more efficient especially if you have lots of articles

Yes, you're completely right, for more than a couple of articles it becomes difficult.

I also see two more problems with this approach:

1. The articles from the category "Neuigkeiten" should be created (& edited) by the teachers from the frontend. I hope I can bring them so far that they will survive this ;-) but I for sure cannot convince them to change something for the module "Kalender" for each and every article they made (and if I have to do this what's the point of let them doing something anyway?!).

2. I plan to add a slide-module on the "START" as well. This slide-module should also only appear on "START" but not on each of the articles of the category "Neuigkeiten".
You do not have the required permissions to view the files attached to this post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Mon May 03, 2021 3:52 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 5:07 pm

> https://docs.joomla.org/How_to_control_ ... _menu_item

Thanks for the link Webdongle!

In the first part

> Linking From One Article to Another

I thought I saw a solution.
However I get to the articles (+ the unwanted calendar-module in the foot) by linking on the title of the article itself so I wasn't able to implement the solution.
Please let me know if I've somehow overseen the right implementation.

The last part let me hope of a possible solution through an extension:

> Controlling Module Display With an Extension
>
> Another approach to the problem is to display modules using an extension that provides detailed control over where a module displays. A list of module management extensions can be found on the JED (Joomla Extension Directory).

Do you have a specific extension in mind?

I've read everything I could find about Regular Labs' "Advanced Module Manager" (first extension from the linked section of JED).
It should allow assigning modules to much more than menu items.
I'm not exactly sure though this will solve my problem because I rather want to NOT have the module "Kalender" appearing together with the articles from the Home-page - that is I want LESS modules, not MORE ;-)
Unfortunately there is no way to directly ask in the Regular Labs' forum unless I already have a subscription.

The second extension - MetaMod - offers actually the same as "Advanced Module Manager" (if I understand correctly).
It was also last updated in January 2017.

Here again: If I misunderstood something about "Advanced Module Manager" or if there is another extension that could do the trick, please let me know!

Thanks again!

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Mon May 03, 2021 5:40 pm

Your home page is likely a blog. So any category and articles of those categories that do not have a menu item
Will have the module displayed even if it is set to display on the home page only
They inherent the settings if they don't have their own menu item.

Don't know how advance module manager works. Don't use it.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 5:58 pm

> Your home page is likely a blog. So any category and articles of those categories that do not have a menu item
> Will have the module displayed even if it is set to display on the home page only
> They inherent the settings if they don't have their own menu item.

I understand now!

And yes, as soon as I add a new menu-item showing only the article "Beitrag Nr. 1" clicking on this article will reveal only the article itself and not the calendar-module anymore.
Bildschirmfoto 2021-05-03 um 19.52.14.png
This kind of solves the problem but it's not usable: For every new article created by the teachers via the frontend a new menu-item (showing only this article) should also be created in order to avoid having the calendar-module to show each time at the bottom of the article and this is not something the teacher could do.

I'll try to put the calendar in the very first article of the showed category.
This will solve at least the problem with the unwanted module at the bottom.

However the slide-module I also plan to implement on the Home-page will behave similarly - showing with each article I click :-(

Is this really the default behavior of a standard blog or do I use it totally false?!
This should not be such an exotic or rare requirement (to see only the article and nothing from the "decoration" of the Home-page), right?

> Don't know how advance module manager works. Don't use it.

I won't use it.

Thanks again, Webdongle, I've learned something new.
You do not have the required permissions to view the files attached to this post.

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 6:37 pm

Another possible solution will be to have nothing clickable in the articles (nor title or "read more"-buttons): you either only read something from the START-page or you click a menu-item (from the navigation bar).

What do you think about this?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Mon May 03, 2021 6:46 pm

Vlad Ghitulescu wrote:
Mon May 03, 2021 6:37 pm
Another possible solution will be to have nothing clickable in the articles (nor title or "read more"-buttons): you either only read something from the START-page or you click a menu-item (from the navigation bar).

...
Nope. Still inherits the home page settings.

Creatye hidden menu items for the categories, Any new Article will inheret the module settings for the category they are in.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 7:11 pm

> Creatye hidden menu items for the categories, Any new Article will inheret the module settings for the category they are in.

What do you mean with creating "hidden menu items for the categories"?

A category-blog, right?

I'm afraid I don't quite understand, sorry, because right now I have already a menu item "Neuigkeiten" (the second one, right to the START at

http://www.tuttmannschule-essen.de/beta/ts001_START/

) set as a category-blog for the same-name category "Neuigkeiten" (this is exactly how the Home-page "START" is also set).

If I hide this menu item "Neuigkeiten" clicking on "Beitrag Nr. 2" or "Beitrag Nr. 3" still brings the unwanted calendar-module at the bottom.

(I make the menu item "Neuigkeiten" visible again by publishing it in order to be visible for our discussion now).

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Mon May 03, 2021 8:14 pm

> Easy option is explained on my blog

It looks like the solution to my very problem…


> "At the same time this inheritance can be source of confusion, despair and even anger."

… and this sounds a lot like me! :-D


You said at the end of your article:

---

> The following code will resolve this for you and you can easily add it to your own Joomla template using the built in template editor.

Code: Select all

<?php if ($view != 'article' && $this->countModules('sidebar', true)) : ?>
    <div>
        <jdoc:include type="modules" name="sidebar" style="default" />
    <div>
<?php endif; ?>
---

I have two questions here:

1. If 'sidebar' is the name of the module it will be "Kalender" in my case, right?

2. Where to put this couple of lines of code? In the file "template.php"?
Bildschirmfoto 2021-05-03 um 22.10.29.png
If so: Where exactly?
You do not have the required permissions to view the files attached to this post.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12069
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Module appears on every page even if it shouldn't

Post by brian » Mon May 03, 2021 9:53 pm

name="sidebar"

This is the name of the module position that you are putting the calendar module into
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Tue May 04, 2021 2:17 am

brian wrote:
Mon May 03, 2021 9:53 pm
name="sidebar"

This is the name of the module position that you are putting the calendar module into

Thank you Brian & sorry for the dumb question, I discovered the hint a couple of line above in your article only after posting :-(

Would you mind telling me where exactly to add the php - if snippet please?

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Fri May 07, 2021 4:18 pm

In the meantime I figured that the file where I should insert the code is template.php (duh!)

Reading the header-comment in template.php I learned that I shouldn't edit this file but copied into a custom.php and only edit this one.

So that is what I did:

- I created the custom.php-file
- I copied template.php into custom.php
- I changed the generic 'sidebar'-position from the article (https://brian.teeman.net/joomla/896-modules-nowhere) into my specific 'grid-bottom'-position and put this code

Code: Select all

<?php if ($view != 'article' && $this->countModules('grid-bottom', true)) : ?>
    <div>
        <jdoc:include type="modules" name="grid-bottom" style="default" />
    <div>
<?php endif; ?>
into the block of code that adressed the 'grid-bottom' - position like this:

Code: Select all

<?php if ($this->countModules('grid-bottom')) : ?>
<!-- grid-bottom -->
<div id="grid-bottom">
	<div class="<?php echo $containerClass; ?>">
			<w:module type="row-fluid" name="grid-bottom" chrome="wrightflexgrid" />
	</div>
</div>
<?php if ($view != 'article' && $this->countModules('grid-bottom', true)) : ?>
	<div>
			<jdoc:include type="modules" name="grid-bottom" style="default" />
	<div>
<?php endif; ?>
<?php endif; ?>
This didn't solved my original problem but instead doubled the content in 'grid-bottom', the second slightly misaligned! (I probably shouldn't edit php-files if I don't know anything about php and template-files! ;-)
Bildschirmfoto 2021-05-07 um 17.58.00.png
So I deleted my custom.php-file… and now I'm back at square 1! :-(
You do not have the required permissions to view the files attached to this post.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12069
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Module appears on every page even if it shouldn't

Post by brian » Fri May 07, 2021 5:31 pm

Try replacing the entire block of code you pasted with this.

Code: Select all

<!-- grid-bottom -->
<?php if ($view != 'article' && $this->countModules('grid-bottom')) : ?>
<div id="grid-bottom">
	<div class="<?php echo $containerClass; ?>">
			<w:module type="row-fluid" name="grid-bottom" chrome="wrightflexgrid" />
	</div>
</div>
<?php endif; ?>
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Fri May 07, 2021 5:53 pm

Thanks, Brian!

I've replaced the code-block with the one you suggested and

a) I don't have any double calendar anymore (hurray!) but
b) it doesn't solve the problem: clicking on "Beitrag Nr. 2" or "Beitrag Nr. 3" opens them… with the calendar at the bottom again :-(

("Beitrag Nr. 1" doesn't have the calendar anymore since I've created a menu-item for it - so it's not relevant)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Fri May 07, 2021 6:12 pm

Vlad Ghitulescu wrote:
Fri May 07, 2021 5:53 pm
...
("Beitrag Nr. 1" doesn't have the calendar anymore since I've created a menu-item for it - so it's not relevant)
Perhaps create menu items for Beitrag Nr. 2" and "Beitrag Nr. 3 ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Fri May 07, 2021 6:16 pm

Yes, Webdongle, I could do this and this will solve the problem for sure for this 3 articles BUT as I said the plan :-) is that the teacher will create new articles for this category from the frontend and they aren't able to create a new menu-item for every single new article they create.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Fri May 07, 2021 8:47 pm

Set the module to display "Only on selected pages' select the menu item for the category blog. That should control the module not to display on on any other page (regardless of whether or not the Article has a menu item).

I just tested it on my site.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Sat May 08, 2021 4:56 am

Thanks for you suggestion Webdongle!

As I mentioned in my first post I've already set the calender-module "Kalender" to only appear on the START-page but unfortunately this doesn't hinder the articles "Beitrag Nr. 2" and "Beitrag Nr. 3" (that doesn't have an own menu-item like "Beitrag Nr. 1") to appear together with the module "Kalender" as you can see in this screenshot:
Bildschirmfoto 2021-05-08 um 06.47.53_opt.png
or in this short screen-recording I've made:

https://www.dropbox.com/s/hdmrjmuutzhzl ... t.mp4?dl=0
You do not have the required permissions to view the files attached to this post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Sat May 08, 2021 8:28 am

OK I see what's happening.
I tested.
I set the login module to appear only on a menu item type Category list
I set an Article that had no menu item to That category
Clicking the link makes the url Category-uncategorised/page but others with menu items resolve to Category-their category/page

But category blog appears differently and displays the module. strange
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Sat May 08, 2021 2:00 pm

Yes, totally!

It is still hard to wrap my head around the fact that every article of the category blog is "damned" :-) to inherit all the module from the parent-page (borrowing now the terms from Brian's article).

That is - as I mentioned on Fri Jul 17, 2015 9:44 pm as a reply to AMurray - also the slide-module that I'll have on the START-page (on another position, 'featured'), even if I would like to show this slide-module (again) ONLY on the START-page (just like the calendar-module).

It can impossibly be only Brian and me that needed something like this, right?!

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39989
Joined: Sat Apr 05, 2008 9:58 pm

Re: Module appears on every page even if it shouldn't

Post by Webdongle » Sat May 08, 2021 3:52 pm

Yeah I've tried with advanced menu module, same result. Also tried with category blog and category list. With both types of menu item the Blog settings take precedence.


You could have a menu that auto added new items for new articles. Then set it to display in a non assigned position. But all those menu extensions I can find are commercial
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Vlad Ghitulescu
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Fri Jul 17, 2015 8:44 pm

Re: Module appears on every page even if it shouldn't

Post by Vlad Ghitulescu » Sat May 08, 2021 4:05 pm

Right now I'm leaning toward:

- making all the articles so short that they fit on the START page (the category is only for the school-news - like the new Corona-tests, or new schedules etc so they could be relatively short - each and in sum),
- letting the titles of the articles NOT to link to the articles anymore and
- hiding the "Read more"-buttons

so there is no possibility and also no need whatsoever to link to a detailed view of one of the news articles.

I think this could work… but then I'm thinking that it becomes somehow counter-intuitive: why making then a couple of articles instead of only one single article containing the current news if it's no need to read more to one of the news on a further page?!


Post Reply

Return to “General Questions/New to Joomla! 3.x”