Menu Assignment? – Joomla! Forum

Menu Assignment? Topic is solved

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

williama

Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun May 18, 2008 10:01 pm

Menu Assignment?

Post by williama » Sun Dec 20, 2020 12:44 am

Hi guys,

I have a slider module that I want to appear on a specific menu option that list articles in category blog view, using menu assignment I’m able to do this, the only problem is that once an article is selected the slider remains too. I only want the slider to appear on this list of articles in that category, not when an article is showing. I can’t see an option for this in menu assignment, is there an easy way around this?

Many thanks.


User avatar

AMurray

Joomla! Champion
Joomla! Champion
Posts: 6259
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Menu Assignment?

Post by AMurray » Sun Dec 20, 2020 4:59 am

Make sure it is only assigned to the menu item linked to the category view, not to the article itself (?).

Do you have an example link you can show us the behaviour you’re not wanting to see? (or screenshots, if the site is not live)?

Perhaps, you need to make menu items for those articles in that category but make them hidden menu items (so they are not displayed on any menu, but are still selectable for “menu assignment” in the Module Manager). To my way of thinking that’s how it would work, when you click the link from the Category Blog view, it should then load the article with with that slider showing.

Regards,
————————————————————–
A Murray
Help you I can, yes!. Post your question, you should. Keep it on topic you must!
Use the Forc….Forum Post Assistant my young Padawan!

User avatar

Per Yngve Berg

Joomla! Master
Joomla! Master
Posts: 27352
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Menu Assignment?

Post by Per Yngve Berg » Sun Dec 20, 2020 8:51 am

Make sure the articles are opened with a different menu item.

If you have two menu itens pointing to the same category, it may pick the one with the lowest ID number.


williama

Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun May 18, 2008 10:01 pm

Re: Menu Assignment?

Post by williama » Sun Dec 20, 2020 11:40 am

Thanks for the reply. The only way I can think to get around it is to create duplicate articles in a second category. Use the first group to display in category blog view with the slider, but have them link to their duplicates in the second category to avoid the slider appearing. I was hoping I wouldn’t need to duplicate things, but never mind.

User avatar

Per Yngve Berg

Joomla! Master
Joomla! Master
Posts: 27352
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Menu Assignment?

Post by Per Yngve Berg » Sun Dec 20, 2020 12:21 pm

Do you have a Read More Break inside the articles?

Embed the module in the intro text and set not to show intro text in single article view.

https://docs.joomla.org/How_do_you_put_ … article%3F


Mr. Wimpy

Joomla! Explorer
Joomla! Explorer
Posts: 330
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Menu Assignment?

Post by Mr. Wimpy » Sun Dec 20, 2020 12:58 pm

*Note: unless you created the template yourself this may be reverted during updates.

I create my own templates and use this often:

Open your template’s index.php file.
Check for the line

Code: Select all

$view     = $app->input->getCmd('view', '');

If it’s not there add it, somewhere at the beginning. See for example the Protostar template.

Then look for the position of the slider:
(*mySliderPosition is an example.)

Code: Select all

countModules('mySliderPosition')) : ?>

and change it to:

Code: Select all

countModules('mySliderPosition') && $view != "article") : ?>

This will display modules on all assigned pages, but not on articles.


williama

Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun May 18, 2008 10:01 pm

Re: Menu Assignment?

Post by williama » Sun Dec 20, 2020 1:40 pm

Amazing, thank you guys I will try this out later.

williama

Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun May 18, 2008 10:01 pm

Re: Menu Assignment?

Post by williama » Sun Dec 20, 2020 4:57 pm

Thanks for this Mr. Wimpy, I’ve had a look and only found the references below. The position of my module is postion-3, should I can new code, or tweak any of the below? Many thanks.

Code: Select all

// Adjusting content width if ($this->countModules('position-7') && $this->countModules('position-8')) { 	$span = 'span6'; } elseif ($this->countModules('position-7') && !$this->countModules('position-8')) { 	$span = 'span9'; } elseif (!$this->countModules('position-7') && $this->countModules('position-8')) { 	$span = 'span9'; } else { 	$span = 'span12'; }

Code: Select all

	countModules('position-1')) : ?> 				

Code: Select all

	 			 			
countModules('position-8')) : ?>
countModules('position-7')) : ?>

ashiq1233

Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Dec 08, 2020 5:53 am

Re: Menu Assignment?

Post by ashiq1233 » Sun Dec 20, 2020 5:20 pm

hi.
how are you?

Mr. Wimpy

Joomla! Explorer
Joomla! Explorer
Posts: 330
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Menu Assignment?

Post by Mr. Wimpy » Sun Dec 20, 2020 5:28 pm

Looks like you are using the protostar template.
I recomend making a copy of protostar and use the copy as the template for your website.
Else these changes will be changed back after a Joomla update.

Anyway…

Find

Code: Select all

and change it to

Code: Select all

    

or to this

Code: Select all

countModules('position-3') && $view != "article") : ?>    

The first snippet of code is good for you.
The second is good if you want to add extra code, like a container (See i.e. position-1, -7 or -8)


williama

Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun May 18, 2008 10:01 pm

Re: Menu Assignment?

Post by williama » Sun Dec 20, 2020 6:48 pm

Hi Mr. Wimpy, great thank you so much. I am using that template, but I have made a copy, I learned the hard way. Works perfectly, thank you again. :)


Related Posts

Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *

Recommended

Welcome Back!

Login to your account below

Create New Account!

Fill the forms bellow to register

Retrieve your password

Please enter your username or email address to reset your password.