Putting a second 'offers' module on the bottom of an article

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Sep 26, 2013 6:31 pm
Reply with quote
Report this post
I am wondering if its possible I can put a second offers module on the bottom of an article page. Literally at the bottom of the article, before the social icons or before the 'about us, guest services, etc' footer links.

Is there any way to do that?

Also:
I have attempted changing the module with some of the positions in the template, but cannot get one exact position I'd like.
User avatar
Senior Boarder

teitbite
Sat Sep 28, 2013 2:06 am
Reply with quote
Report this post
Hi

You can always add a new module position directly to the article layout. Please edit /html/com_k2/default/item.php and find a place for this new module (elements are named in comments). Here is the code to load a module:

Code: Select all
      <?php
         $modules =& JModuleHelper::getModules('NAME_OF_YOUR_NEW_MODULE_POSITION');
         foreach ($modules as $module) {
            echo JModuleHelper::renderModule($module);
         }
      ?>
User avatar
Moderator

teitbite
Wed Oct 02, 2013 11:51 am
Reply with quote
Report this post
Hi

I got Your PM with an ask for more detailed help.

1. Please edit file: /templates/NAME_OF_YOUR_TEMPATE/html/com_k2/default/item.php
2. Find a code responsible for adding text of an article, it looks like this:

Code: Select all
                  <?php if(!empty($this->item->fulltext)): ?>
                  <?php if($params->get('itemIntroText')): ?>
                  <div class="itemIntroText">
                           <?php echo $this->item->introtext; ?>
                  </div>
                  <?php endif; ?>
                  <?php endif; ?>
                  <?php if($params->get('itemFullText')): ?>
                  <div class="itemFullText">
                           <?php echo (!empty($this->item->fulltext)) ? $this->item->fulltext : $this->item->introtext; ?>
                  </div>
                  <?php endif; ?>


3. Copy this code under the one from point 2

Code: Select all
   <?php
         $modules =& JModuleHelper::getModules('NAME_OF_YOUR_NEW_MODULE_POSITION');
         foreach ($modules as $module) {
            echo JModuleHelper::renderModule($module);
         }
      ?>


4. Add a module to the custom module positions called the same as the one in code added (NAME_OF_YOUR_NEW_MODULE_POSITION).

That's all :) I hope this will clear everything up.
User avatar
Moderator


cron