How to know article id to customize the page Topic is solved

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
floyd1616
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Sep 20, 2008 10:28 am
Contact:

How to know article id to customize the page

Post by floyd1616 » Thu May 19, 2022 10:41 am

Hello everybody,
in joomla I created a category with some articles.
The menu item, of course, is of the "blog category" type.

I would like to associate a custom module to one of the articles of the blog category, of which I know its ID. For example id = 3. I wrote the following code in the section head of index.php template:

Code: Select all

<?php 
$article_id = 3;
?> 

<?php if($this->countModules('ModuleName') && $view == 'article' && $article_id == 3) : ?>
    <jdoc:include type="modules" name="ModuleName" style="none" />
<?php endif; ?>
but the custom module appears to me in all the articles of the blog category and not with the one with id = 3.

Is there the possibility of associating the module only with that article?

Thank you
Last edited by toivo on Tue May 24, 2022 8:47 am, edited 2 times in total.
Reason: mod note: moved from 3.x Coding

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17425
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: How to know article id to customize the page

Post by toivo » Tue May 24, 2022 3:50 am

There is no need to modify the template or even to know the id of the article. The free extension Advanced Module Manager by Regular Labs does the job. The following selections are needed in the Assignments tab of the custom module:
  • Matching Method: Any
  • Articles: Include
  • Selection: { - article title - }
Toivo Talikka, Global Moderator

floyd1616
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Sep 20, 2008 10:28 am
Contact:

Re: How to know article id to customize the page

Post by floyd1616 » Tue May 24, 2022 8:05 am

Thanks for the reply.
I will be using Advanced Module Manager.
You can close the post if you want
Best regards


Locked

Return to “Extensions for Joomla! 3.x”