We moved to new unified forum!

Please post all new support queries in our New Forum.

T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Roman
  2. General Discussion
  3. Wednesday, 01 October 2014
  4.  Subscribe via email
Hi!
At site I have one module, which loooks good only on wide and normal screen.
stroyprom.by
Site used one sidebar. Module have position user-15. In tempate options i cant hide this module for tablets and mobiles - there are no eye (attached). Is it possible to hide him only for some devices?
code looks like
$layout_config = json_decode ('{
"two_sidebars": {
"default" : [ "span6 offset3" , "span3 offset-9" , "span3" ],
"wide" : [],
"xtablet" : [],
"tablet" : [ "span12" , "span6 spanfirst" , "span6" ]
},
"one_sidebar1": {
"default" : [ "span9 pull-right" , "span3" ],
"wide" : [],
"xtablet" : [ "span8 pull-right" , "span4" ],
"tablet" : [ "span12" , "span12 spanfirst" ]
},
"one_sidebar2": {
"default" : [ "span9" , "span3" ],
"wide" : [],
"xtablet" : [ "span8" , "span4" ],
"tablet" : [ "span12" , "span12 spanfirst" ]
},
"no_sidebar": {
"default" : [ "span12" ]
}
}');

// positions configuration
$sidebar1 = 'sidebar-1';
$sidebar2 = 'sidebar-2';
$content = 'content';
$prod = 'user-15';
$prod2 = 'user-16';
$prod3 = 'user-17';
$prod4 = 'user-18';


// Detect layout
if ($this->countModules("$sidebar1 and $sidebar2")) {
$layout = 'two_sidebars';
} elseif ($this->countModules($sidebar1)) {
$layout = 'one_sidebar1';
} elseif ($this->countModules($sidebar2)) {
$layout = 'one_sidebar2';
} else {
$layout = 'no_sidebar';
}
$layout = $layout_config->$layout;

$col = 0;
?>






div i="t3-content" class="t3-content getClass($layout, $col) ?>" getData ($layout, $col++) ?>>
hasMessage()):?>


jdoc:iclude type="modules" name="_p($content) ?>" style="T3Xhtml" />
" style="T3Xhtml" />
" style="T3Xhtml" />
" style="T3Xhtml" />
" style="T3Xhtml" />




countModules($sidebar1)) : ?>

div cass="t3-sidebar t3-sidebar-1 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar1)?>" getData ($layout, $col++) ?>>
" style="T3Xhtml" />



In templateDetails.xml this position look the same all another positions.

Thanks! Sorry for the bad english.
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Great solution @Igor Cunha. It seems I failed in this case :D
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Hi, Igor!

Thank you very much for your response. This is exactly what I need. I made changes in code like yours...

<div id="t3-mainbody" >
<section class="container t3-mainbody">
<div class="row">
<div class="main-content">
<!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content <?php echo $this->getClass($layout, $col) ?>" <?php echo $this->getData ($layout, $col++) ?>>
<?php if($this->hasMessage()):?>
<jdoc:include type="message" />
<?php endif; ?>
<jdoc:include type="modules" name="<?php $this->_p($content) ?>" style="T3Xhtml" />
<jdoc:include type="component" />
<?php if ($this->countModules($prod)) : ?>
<!-- USER 15 -->
<div class="class="wrap <?php $this->_c('$prod')?>">
<jdoc:include type="modules" name="<?php $this->_p($prod) ?>" style="raw" />
</div>
<!-- //USER 15 -->
<?php endif ?>
<?php if ($this->countModules($prod2)) : ?>
<!-- USER 16 -->
<div class="class="wrap <?php $this->_c('$prod2')?>">
<jdoc:include type="modules" name="<?php $this->_p($prod2) ?>" style="raw" />
</div>
<!-- //USER 16 -->
<?php endif ?>
<?php if ($this->countModules($prod3)) : ?>
<!-- USER 17 -->
<div class="class="wrap <?php $this->_c('$prod3')?>">
<jdoc:include type="modules" name="<?php $this->_p($prod3) ?>" style="raw" />
</div>
<!-- //USER 17 -->
<?php endif ?>
</div>
<!-- //MAIN CONTENT -->


now i can hide positions user-15, user-16 and user-17 in template options (attached). I closed posion user-16 and user-17 for Mobile, but they still are shown at smartphones (attached). these are my hands the curves?)
Attachments (3)
References
  1. http://stroyprom.by/
  Minsk, Belarus
Visit 
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Is this what you want ?

block mainbody-p:

 
<?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
*/

/**
* Mainbody 3 columns, content in center: sidebar1 - content - sidebar2
*/
defined('_JEXEC') or die;
?>
<?php

// Layout configuration
$layout_config = json_decode ('{
"two_sidebars": {
"default" : [ "span6 offset3" , "span3 offset-9" , "span3" ],
"wide" : [],
"xtablet" : [],
"tablet" : [ "span12" , "span6 spanfirst" , "span6" ]
},
"one_sidebar1": {
"default" : [ "span9 pull-right" , "span3" ],
"wide" : [],
"xtablet" : [ "span8 pull-right" , "span4" ],
"tablet" : [ "span12" , "span12 spanfirst" ]
},
"one_sidebar2": {
"default" : [ "span9" , "span3" ],
"wide" : [],
"xtablet" : [ "span8" , "span4" ],
"tablet" : [ "span12" , "span12 spanfirst" ]
},
"no_sidebar": {
"default" : [ "span12" ]
}
}');

// positions configuration
$sidebar1 = 'sidebar-1';
$sidebar2 = 'sidebar-2';

// Detect layout
if ($this->countModules("$sidebar1 and $sidebar2")) {
$layout = 'two_sidebars';
} elseif ($this->countModules($sidebar1)) {
$layout = 'one_sidebar1';
} elseif ($this->countModules($sidebar2)) {
$layout = 'one_sidebar2';
} else {
$layout = 'no_sidebar';
}
$layout = $layout_config->$layout;

$col = 0;
?>

<div id="t3-mainbody" class="container t3-mainbody">
<div class="row">

<!-- MAIN CONTENT -->
<div id="t3-content" class="t3-content <?php echo $this->getClass($layout, $col) ?>" <?php echo $this->getData ($layout, $col++) ?>>
<jdoc:include type="message" />
<jdoc:include type="component" />

<?php if ($this->countModules('position-1')) : ?>
<!-- POSITION 1 -->
<div class="wrap <?php $this->_c('position-1')?>">
<jdoc:include type="modules" name="<?php $this->_p('position-1') ?>" style="raw" />
</div>
<!-- //POSITION 1 -->
<?php endif ?>

<?php if ($this->countModules('position-2')) : ?>
<!-- POSITION 2 -->
<div class="wrap <?php $this->_c('position-2')?>">
<jdoc:include type="modules" name="<?php $this->_p('position-2') ?>" style="raw" />
</div>
<!-- //POSITION 2 -->
<?php endif ?>

<?php if ($this->countModules('position-3')) : ?>
<!-- POSITION 3 -->
<div class="wrap <?php $this->_c('position-3')?>">
<jdoc:include type="modules" name="<?php $this->_p('position-3') ?>" style="raw" />
</div>
<!-- //POSITION 3 -->
<?php endif ?>

<?php if ($this->countModules('position-4')) : ?>
<!-- POSITION 4 -->
<div class="wrap <?php $this->_c('position-4')?>">
<jdoc:include type="modules" name="<?php $this->_p('position-4') ?>" style="raw" />
</div>
<!-- //POSITION 4 -->
<?php endif ?>

</div>
<!-- //MAIN CONTENT -->

<?php if ($this->countModules($sidebar1)) : ?>
<!-- SIDEBAR 1 -->
<div class="t3-sidebar t3-sidebar-1 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar1)?>" <?php echo $this->getData ($layout, $col++) ?>>
<jdoc:include type="modules" name="<?php $this->_p($sidebar1) ?>" style="T3Xhtml" />
</div>
<!-- //SIDEBAR 1 -->
<?php endif ?>

<?php if ($this->countModules($sidebar2)) : ?>
<!-- SIDEBAR 2 -->
<div class="t3-sidebar t3-sidebar-2 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar2)?>" <?php echo $this->getData ($layout, $col++) ?>>
<jdoc:include type="modules" name="<?php $this->_p($sidebar2) ?>" style="T3Xhtml" />
</div>
<!-- //SIDEBAR 2 -->
<?php endif ?>

</div>
</div>
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
I add new positins to Main content with _p to mainbody2.php

// positions configuration
$sidebar1 = 'sidebar-1';
$sidebar2 = 'sidebar-2';
$content = 'content';
$prod = 'user-15';
$prod2 = 'user-16';
$prod3 = 'user-17';
$prod4 = 'user-18';
$prod6 = 'user-30';
$prod7 = 'user-31';
$prod8 = 'user-32';
$prod9 = 'user-33';

...

<jdoc:include type="modules" name="<?php $this->_p($prod6) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod7) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod8) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod9) ?>" style="T3Xhtml" />


and to templateDetails.xml

<position>user-30</position>
<position>user-31</position>
<position>user-32</position>
<position>user-33</position>


but they also havn't options to hide... =(
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Gardner,

Thanks for the answer. Is it something wrong in my code? Its look like all positions use _p.

// positions configuration
$sidebar1 = 'sidebar-1';
$sidebar2 = 'sidebar-2';
$content = 'content';
$prod = 'user-15';
$prod2 = 'user-16';
$prod3 = 'user-17';
$prod4 = 'user-18';

...

<div id="t3-content" class="t3-content <?php echo $this->getClass($layout, $col) ?>" <?php echo $this->getData ($layout, $col++) ?>>
<?php if($this->hasMessage()):?>
<jdoc:include type="message" />
<?php endif; ?>
<jdoc:include type="modules" name="<?php $this->_p($content) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod2) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod3) ?>" style="T3Xhtml" />
<jdoc:include type="modules" name="<?php $this->_p($prod4) ?>" style="T3Xhtml" />
<jdoc:include type="component" />
</div>
<!-- //MAIN CONTENT -->

<?php if ($this->countModules($sidebar1)) : ?>
<!-- SIDEBAR 1 -->
<div class="t3-sidebar t3-sidebar-1 <?php echo $this->getClass($layout, $col) ?><?php $this->_p($sidebar1)?>" <?php echo $this->getData ($layout, $col++) ?>>
<jdoc:include type="modules" name="<?php $this->_p($sidebar1) ?>" style="T3Xhtml" />
</div>
<!-- //SIDEBAR 1 -->
<?php endif ?>

<?php if ($this->countModules($sidebar2)) : ?>
<!-- SIDEBAR 2 -->
<div class="t3-sidebar t3-sidebar-2 <?php echo $this->getClass($layout, $col) ?><?php $this->_p($sidebar2)?>" <?php echo $this->getData ($layout, $col++) ?>>
<jdoc:include type="modules" name="<?php $this->_p($sidebar2) ?>" style="T3Xhtml" />
</div>
<!-- //SIDEBAR 2 -->
<?php endif ?>


thx.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 5
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Roman,

When adding new position that can be configured in responsive layouts, please make sure you use "_p". Following is an example.

<jdoc:include type="modules" name="<?php $this->_p($sidebar1) ?>" style="T3Xhtml" />


Apply this to other positions.

Gardner.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.