Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Add a new position

  • Jordi Sorts Quintana
  • Jordi Sorts Quintana's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 2 months ago #136817 by Jordi Sorts Quintana
Jordi Sorts Quintana created the topic: Add a new position
Hello,

I need to add a new position in a template (like nuMuzik_Sidebar_Top) ,but I need a float on the left.

Please can you explain how I can do for add ?

Thanks.

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #136818 by Yiota Ziaggou
Yiota Ziaggou replied the topic: Add a new position
You will have to make some changes in your index.php

Between lines 183 and 216 (if you haven't modified the file) there is the block that loads the nuMuzik_Sidebar_Top along with the component and nuMuzik_Component module position.

The if block checks if you are in an item page or not and loads the module positions and component differently.

I assume you need the new left block loading in all pages but the item/article page.
Let's name it nuMuzik_Sidebar_Left. The new block should be this
<?php if( !($option=='com_k2' && $view=='item') && !($option=='com_content' && $view=='article') ): 
  			//Check if we have an article(com_content) or item (com_k2) on our hands ?>
  			<?php if($this->countModules('nuMuzik_Sidebar_Left')): ?>
        <aside class="column four sideBar floatLeft mobile-four">
          <jdoc:include type="modules" name="nuMuzik_Sidebar_Left" style="nu" />
        </aside>
        <?php endif; ?>
  			
  			<div class="column <?php echo $layoutCheckUpper; ?> componentArea mobile-four">
  								
  				<?php if($this->countModules('nuMuzik_Component')): ?>
  				<jdoc:include type="modules" name="nuMuzik_Component" style="nu" />
  				<?php endif; ?>
  								
  				<jdoc:include type="component" />
  			</div>
  			
  			<?php if($this->countModules('nuMuzik_Sidebar_Top')): ?>
  			<aside class="column four sideBar mobile-four">
  				<jdoc:include type="modules" name="nuMuzik_Sidebar_Top" style="nu" />
  			</aside>
  			<?php endif; ?>
			
			<?php else: //Indeed it is an article/k2 item execute the code bellow ?>
			  
  			<?php if($this->countModules('nuMuzik_Component')): ?>
  			<jdoc:include type="modules" name="nuMuzik_Component" style="nu" />
  			<?php endif; ?>
  			
  			<jdoc:include type="component" />
  			
  			<?php if($this->countModules('nuMuzik_Sidebar_Top')): ?>
  			<aside class="column four sideBar">
  				<jdoc:include type="modules" name="nuMuzik_Sidebar_Top" style="nu" />
  			</aside>
  			<?php endif; ?>
  			
  			<div class="clr"></div>
			
			<?php endif; ?>

Then you will also have to modify the helper.php file which is located in the includes folder.

Replace the line
$layoutCheckUpper = ($this->countModules('nuMuzik_Sidebar_Top'))?'eight':'twelve';
with
if ($this->countModules('nuMuzik_Sidebar_Top') && $this->countModules('nuMuzik_Sidebar_Left')) {  
  $layoutCheckUpper = 'four';
} elseif ($this->countModules('nuMuzik_Sidebar_Top') || $this->countModules('nuMuzik_Sidebar_Left')) {
  $layoutCheckUpper = 'eight';
} else {
  $layoutCheckUpper = 'twelve';  
}

Note to new users: Please remember to search the forum before posting a question!

Please Log in or Create an account to join the conversation.

  • Jordi Sorts Quintana
  • Jordi Sorts Quintana's Avatar Topic Author
  • Offline
  • Junior Member
More
6 years 1 month ago #136819 by Jordi Sorts Quintana
Jordi Sorts Quintana replied the topic: Add a new position
Many many many Thanks !!!!! It's working perfect !!!!!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum