1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

IT TheLodge 2 We are proud to announce the release of our January 2012 Premium Joomla Template IT TheLodge 2
A complete hotel based template that accepts instantly your website bookings, even through PayPal..

View Demo or Read More

Welcome, Guest
Please Login or Register.    Lost Password?

Optional: Placing a module ONLY in one specific article
(1 viewing) (1) Guest
Go to bottom
Post Reply
Post New Topic
Page: 1
TOPIC: Optional: Placing a module ONLY in one specific article
Optional: Placing a module ONLY in one specific article 1 Year, 11 Months ago #10424
I know this is not specific to your templates, but I thought you might be generous in providing a clue.

Let's say i want to place a cast list for a film - "Book of Eli" - in one of the left module positions within the review page of "The Book of Eli" only. I don't want it in the section - I don't want it in the category - I don't want it in the review for "Edge of Darkness." Just in the right position of one article.

Ideally, the page would have the review in the center,then the cast list, a "Buy from Amazon" bug (specific to the film), and maybe some kind of star rating using the left hand module positions. Every review article would have its own load of individualized modules.

So far, I've found out I can load modules INTO the content, but I've found no mention on how to customize the module spaces in individual article pages.

For me, the ability to do this is huge: when i code pages outside of Joomla, I use those right and left sides to pack on additional content notes. I NEED to be able to do this.

Pleasepleasepleaseplease - hand me a clue if you have one.


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
perigee
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
Re:Optional: Placing a module ONLY in one specific article 1 Year, 11 Months ago #10427
This can be done two ways.
1: Check this module here if it will suit your needs:
extensions.joomla.org/extensions/access-...-access/3391/details

2: You can add some php logic to the templates index.php file to controll where to show the module:
Code:

  <?php $article_ids = array(1); ?>
<?php if($option == 'com_content' && JRequest::getString('view') == 'article' && in_array(JRequest::getInt('id'),$article_ids)):?>
<div>
<jdoc:include type="modules" name="mycustomarticlemodule" style="xhtml" />
 </div>
<?php endif; ?>



If you use the above code you need to:
1:Change the article nr in array(1) to suit your article id/id's to show this specific module on.
2:Change module name to suit your module for use.
3:Change module style to the style you want to use on it
4:Add it in the templates index.php where you want to show it.


Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Menalto
Posts: 1360
graphgraph
User Offline Click here to see the profile of this user
oopsit_v2 joomlasupport@gmail.com
Need an rockstar Joomla developer on board? Send me an email, Skype me or Google Talk me if interested.I am available.
Reply Quote
 
Go to top
Post Reply
Post New Topic
Page: 1
Moderators: Andel, juljan, Brunilda, Tomi

Earn 20% of every sale that is generated from your website and generate and extra income! Join Affiliate Program

Newsletter Subscribe

Subscribe to our newsletters to be notified about our important news.