-
AuthorPosts
-
Ninja Lead Moderator
Ninja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
June 2, 2014 at 10:44 am #537393You can try with my following workaround:
+ Open templates/purity_iii/tpls/blocks/mainbody.php file
Change
$this->loadBlock('mainbody/two-sidebar', array('sidebar1' => $sidebar1, 'sidebar2' => $sidebar2));
To
$this->loadBlock('mainbody/two-sidebar', array('sidebar1' => $sidebar1, 'sidebar2' => $sidebar2, 'new_position' => 'new_position'));
+ Open templates/purity_iii/tpls/blocks/mainbody/two-sidebar.php file
Change
<!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->
To
<?php if ($this->countModules('new_position')) : ?>
<!-- new position -->
<div class="new_position hidden-xs <?php $this->_c('new_position') ?>">
<jdoc:include type="modules" name="<?php $this->_p('new_position') ?>" style="raw" />
</div>
<!-- //new position -->
<?php endif ?><!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->Then you will see new position before content.
brankopilic Friendbrankopilic
- Join date:
- December 2014
- Posts:
- 131
- Downloads:
- 0
- Uploads:
- 70
- Thanks:
- 53
- Thanked:
- 5 times in 1 posts
June 2, 2014 at 1:04 pm #537417Great Ninja, this worked perfectly to add new position.
Ninja is there any way that we can add this position between sidebar 1 and sidebar 2, here is print screen:
In addition, I tried to add this position to templateDetails.xml file in order to have it available for module.
print screen:after added this new_poistion to templateDetails.xml it was available to assign module to that position:
but module is not showing up!? Somehow. I have assign module to every page and menu to correct template but it still do not show module in that position.
I can assume that this new position should be added in “custom position” I am not sure where is that file from this print screen
<em>@Ninja Lead 430238 wrote:</em><blockquote>You can try with my following workaround:
+ Open templates/purity_iii/tpls/blocks/mainbody.php file
Change
$this->loadBlock('mainbody/two-sidebar', array('sidebar1' => $sidebar1, 'sidebar2' => $sidebar2));
To
$this->loadBlock('mainbody/two-sidebar', array('sidebar1' => $sidebar1, 'sidebar2' => $sidebar2, 'new_position' => 'new_position'));
+ Open templates/purity_iii/tpls/blocks/mainbody/two-sidebar.php file
Change
<!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->
To
<?php if ($this->countModules('new_position')) : ?>
<!-- new position -->
<div class="new_position hidden-xs <?php $this->_c('new_position') ?>">
<jdoc:include type="modules" name="<?php $this->_p('new_position') ?>" style="raw" />
</div>
<!-- //new position -->
<?php endif ?><!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->Then you will see new position before content.</blockquote>
- Ninja Lead Moderator
Ninja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
June 3, 2014 at 8:10 am #537559My solution below will help you to add new position between sidebar 1 and sidebar 2
Open templates/purity_iii/tpls/blocks/mainbody/two-sidebar.php file
Change
<?php if ($this->countModules('new_position')) : ?>
<!-- new position -->
<div class="new_position hidden-xs <?php $this->_c('new_position') ?>">
<jdoc:include type="modules" name="<?php $this->_p('new_position') ?>" style="raw" />
</div>
<!-- //new position -->
<?php endif ?><!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->
To
<!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content col-xs-12 col-md-6 col-md-push-3">
<?php if ($this->countModules('new_position')) : ?>
<!-- new position -->
<div class="new_position hidden-xs <?php $this->_c('new_position') ?>">
<jdoc:include type="modules" name="<?php $this->_p('new_position') ?>" style="raw" />
</div>
<!-- //new position -->
<?php endif ?><?php if($this->hasMessage()) : ?>
<jdoc:include type="message" />
<?php endif ?>
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->About it available for module you can try to do it with my solution again
Open templates/purity_iii/templateDetails.xml file
Change
<position>debug</position>
To
<position>debug</position>
<position>new_position</position>1 user says Thank You to Ninja Lead for this useful post
brankopilic Friendbrankopilic
- Join date:
- December 2014
- Posts:
- 131
- Downloads:
- 0
- Uploads:
- 70
- Thanks:
- 53
- Thanked:
- 5 times in 1 posts
June 3, 2014 at 9:28 pm #537665Hmmm, Ninja added your codes but somehow module is not showing up!?
Here is a module (test):
Menu assignment (all pages):
Check to this page: http://blog.immigrationuslawyer.com/citizenship
Template Style (Purity III – Corporate):
Corporate Layout (new_position) between sidebar 1 and sidebar 2:
Position on this page above (/?tp=1) http://blog.immigrationuslawyer.com/citizenship/?tp=1:
And this module is not showing up somehow? Can you help why? This actually happen when I also used your first solution.
Just in case full code that I have for templates/purity_iii/tpls/blocks/mainbody/two-sidebar.php
<?php
/**
* @package T3 Blank
* @copyright Copyright (C) 2005 – 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/defined(‘_JEXEC’) or die;
/**
* Mainbody 3 columns, content in center: sidebar1 – content – sidebar2
*/
?><div id=”t3-mainbody” class=”container t3-mainbody”>
<div class=”row”><!– MAIN CONTENT –>
<div id=”t3-content” class=”t3-content col-xs-12 col-md-6 col-md-push-3″>
<?php if ($this->countModules(‘new_position’)) : ?>
<!– new position –>
<div class=”new_position hidden-xs <?php $this->_c(‘new_position’) ?>”>
<jdoc:include type=”modules” name=”<?php $this->_p(‘new_position’) ?>” style=”raw” />
</div>
<!– new position –>
<?php endif ?><?php if($this->hasMessage()) : ?>
<jdoc:include type=”message” />
<?php endif ?>
<jdoc:include type=”component” />
</div>
<!– //MAIN CONTENT –><!– SIDEBAR 1 –>
<div class=”t3-sidebar t3-sidebar-1 col-xs-6 col-md-3 col-md-pull-6 <?php $this->_c($vars[‘sidebar1’]) ?>”>
<jdoc:include type=”modules” name=”<?php $this->_p($vars[‘sidebar1’]) ?>” style=”T3Xhtml” />
</div>
<!– //SIDEBAR 1 –><!– SIDEBAR 2 –>
<div class=”t3-sidebar t3-sidebar-2 col-xs-6 col-md-3 <?php $this->_c($vars[‘sidebar2’]) ?>”>
<jdoc:include type=”modules” name=”<?php $this->_p($vars[‘sidebar2’]) ?>” style=”T3Xhtml” />
</div>
<!– //SIDEBAR 2 –></div>
</div>and for templates/purity_iii/templateDetails.xml
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE install PUBLIC “-//Joomla! 1.6//DTD template 1.0//EN” “http://www.joomla.org/xml/dtd/1.6/template-install.dtd”>
<extension version=”2.5″ type=”template” method=”upgrade” client=”site”>
<name>purity_III</name>
<version>1.0.1</version>
<creationDate>21 March 2014</creationDate>
<author>JoomlArt.com</author>
<authorEmail>webmaster@joomlart.com</authorEmail>
<authorUrl>http://www.t3-framework.org</authorUrl>
<copyright>Copyright (C), J.O.O.M Solutions Co., Ltd. All Rights Reserved.</copyright>
<license>license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html</license>
<t3>
<base>base-bs3</base>
</t3>
<description>
<!#468847[/URL]padding: 1px 0;”>
<h2>Purity III Template references</h2>
<h4><a href=”http://joomla-templates.joomlart.com/purity_iii/” title=”Purity III Template demo”>Live Demo</a> | <a href=”http://www.joomlart.com/documentation/joomla-templates/purity-iii” title=”purity iii template documentation”>Documentation</a> | <a href=”http://www.joomlart.com/forums/forum/purity-iii/” title=”purity iii forum”>Forum</a> | <a href=”http://www.joomlart.com/joomla/templates/purity-iii” title=”Purity III template more info”>More Info</a></h4>
<p> </p>
<span style=”color:#FF0000″>Note: Purity III requires T3 plugin to be installed and enabled.</span>
<p> </p>
<p>Copyright 2004 – 2014 <a href=’http://www.joomlart.com/’ title=’Visit Joomlart.com!’>JoomlArt.com</a>.</p>
</div>
<style>table.adminform{width: 100%;}</style>
</div>
]]>
</description>
<files>
<filename>component.php</filename>
<filename>favicon.ico</filename>
<filename>index.html</filename>
<filename>index.php</filename>
<filename>thememagic.xml</filename>
<filename>templateInfo.php</filename>
<filename>templateHook.php</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
<filename>templateDetails.xml</filename>
<filename>helper.php</filename>
<filename>offline.php</filename>
<filename>error.php</filename>
<folder>etc</folder>
<folder>fonts</folder>
<folder>html</folder>
<folder>css</folder>
<folder>js</folder>
<folder>less</folder>
<folder>language</folder>
<folder>images</folder>
<folder>tpls</folder>
</files><languages folder=”language”>
<language tag=”en-GB”>en-GB/en-GB.tpl_purity_iii.ini</language>
<language tag=”en-GB”>en-GB/en-GB.tpl_purity_iii.sys.ini</language>
</languages><positions>
<position>languageswitcherload</position>
<position>head-search</position>
<position>mainnav</position>
<position>navhelper</position>
<position>breadcrumbs</position>
<position>off-canvas</position>
<position>sidebar-1</position>
<position>sidebar-2</position>
<position>mast-col</position>
<position>footer</position>
<position>features-intro-1</position>
<position>position-0</position>
<position>position-1</position>
<position>position-2</position>
<position>position-3</position>
<position>position-4</position>
<position>position-5</position>
<position>position-6</position>
<position>position-7</position>
<position>position-8</position>
<position>position-9</position>
<position>position-10</position>
<position>position-11</position>
<position>position-12</position>
<position>position-13</position>
<position>position-14</position>
<position>position-15</position>
<position>footer-0</position>
<position>footer-1</position>
<position>footer-2</position>
<position>footer-3</position>
<position>footer-4</position>
<position>footer-5</position>
<position>footer-6</position>
<position>footer-7</position>
<position>footer-8</position>
<position>footer-9</position>
<position>footer-10</position>
<position>debug</position>
<position>new_position</position>
</positions><config>
<fields name=”params” addfieldpath=”/plugins/system/t3/includes/depend”><!– Sample for add or disable template parameters –>
<!–fieldset name=”menu_params” label=”T3_PARAMS_MEGAMENU”>
<field name=”group_disable” type=”t3depend” function=”@group”>
<option for=”menu_as_bg” value=”no”>menu_as_bg</option>
</field>
</fieldset–><fieldset name=”purity_iii_params” label=”TPL_EXTENDED_TAB_LABEL” description=”TPL_EXTENDED_TAB_LABEL”>
<field name=”tpl_article_info_datetime_format” type=”list” default=”d M Y”
global=”1″
label=”TPL_ARTICLE_INFO_DATETIME_FORMAT_LABEL”
description=”TPL_ARTICLE_INFO_DATETIME_FORMAT_DESC”>
<option value=”d M Y”>TPL_DATE_SHORT</option>
<option value=”d F Y”>TPL_DATE_FULL_MONTH</option>
<option value=”l, d F Y”>TPL_DATE_FULL</option>
</field></fieldset>
</fields>
</config><updateservers>
<server type=”collection”>http://update.joomlart.com/service/tracking/list.xml</server>
</updateservers></extension>
- Ninja Lead Moderator
Ninja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
June 4, 2014 at 4:02 am #537683Because the corporate of layout on your site is using with “one-sidebar-left” from templates/purity_iii/tpls/blocks/mainbody/one-sidebar-left.php file, “one-sidebar-right” from templates/purity_iii/tpls/blocks/mainbody/one-sidebar-right.php file and no-sidebar from templates/purity_iii/tpls/blocks/mainbody/no-sidebar.php file but you have only added script code below into two-sidebar.php file
<?php if ($this->countModules('new_position')) : ?>
<!-- new position -->
<div class="new_position hidden-xs <?php $this->_c('new_position') ?>">
<jdoc:include type="modules" name="<?php $this->_p('new_position') ?>" style="raw" />
</div>
<!-- //new position -->
<?php endif ?>
I did helped you to add it all other files. For now, the new_position position is working on your site. please check it again
1 user says Thank You to Ninja Lead for this useful post
brankopilic Friendbrankopilic
- Join date:
- December 2014
- Posts:
- 131
- Downloads:
- 0
- Uploads:
- 70
- Thanks:
- 53
- Thanked:
- 5 times in 1 posts
June 4, 2014 at 9:06 am #537720Thanks a lot Ninja for all your time and help. Stay like that
October 4, 2016 at 8:53 am #973321Great info.
You can add more than one module position before AND after content using this code.
I have Purity III 1.1.7 on Joomla 3.6.2 and it works great. I ran into one problem with the layout showing the positions, but they weren’t visible, found that I had inadvertently inserted the code within the "if/endif" statement for the message container. Aside from that, implementation was easy and quick.
Many thanks for the information, it helped me greatly.
AuthorPostsViewing 7 posts - 1 through 7 (of 7 total)This topic contains 7 replies, has 3 voices, and was last updated by mrtexas 7 years, 6 months ago.
The topic ‘how to add position before content?’ is closed to new replies.
Jump to forum
how to add position before content?
Viewing 7 posts - 1 through 7 (of 7 total)