Перейти к содержимому


Фотография
- - - - -

Не получается создать несколько тизеров для одного типа

тизер тип элемента

Лучший Ответ Шингисович , 13 July 2015 - 18:21

Это грозит как минимум фатальной ошибкой

Вы правы. Синтаксис неправильный был.

Заменил на другой вывод. Все получилось :)) :

<?php
/**
 * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
 *
 * @package     jbzoo
 * @version     2.x Pro
 * @author      JBZoo App http://jbzoo.com
 * @copyright   Copyright (C) JBZoo.com,  All rights reserved.
 * @license     http://jbzoo.com/license-pro.php JBZoo Licence
 * @coder       Denis Smetannikov <denis@jbzoo.com>
 */
 
// no direct access
defined('_JEXEC') or die('Restricted access');
 
$align = $this->app->jbitem->getMediaAlign($item, $layout); 
?>
<?php 
$itemid = JRequest::getInt('Itemid');
if($itemid == '151'):  ?>
<div class="uk-grid uk-grid-collapse" style="margin-bottom: 0px;">
<div class="uk-width-6-6 uk-grid-collapse" style="">
   <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('video'); ?>
    </div>
	<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
<div class="uk-icon-button" style="font-family: arial; position: absolute;   right: 40px; top: 20px; z-index: 100; color: #598D9E;">
	<?php echo $this->renderPosition('media'); ?></div>
	</div>
	<div class="uk-width-6-6 uk-grid-collapse" style="">
    <h4 class="item-title" style="font-family: arial; font-size: 13px; line-height: 16px; letter-spacing: 0px; margin-bottom: 5px;">
	<?php echo $this->renderPosition('title'); ?></h4> 
		</div>
		</div>
<?php else: // Показ позиции в остальных пунктах меню ?>
 
<div class="uk-grid uk-grid-collapse block-divider" style="margin-bottom: 0px;"> 
<div class="uk-width-2-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('image')) : ?>
    <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('image'); ?>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('text')) : ?>
<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
<div class="uk-width-4-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('title')) : ?>
    <div class="item-image" style="font-family: arial; float:left; font-size: 13px; line-height: 15px; color: #598D9E; padding-right: 3px;">
	<?php echo $this->renderPosition('media'); ?></div><h4 class="item-title" style="font-family: arial; font-size: 13px; line-height: 16px; letter-spacing: 0px; margin-bottom: 5px;">
	<?php echo $this->renderPosition('title'); ?></h4>   
<?php endif; ?>
<?php if ($this->checkPosition('properties')) : ?>
    <div class="item-properties">
        <ul class="uk-list uk-list-line">
            <?php echo $this->renderPosition('properties', array('style' => 'list')); ?>
        </ul>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('smi')) : ?>
<div class="uk-width-1-1 uk-text-truncate" style="font-family: arial; margin-bottom: 20px; font-weight: bolder; color: #9B9B9B;">
    <?php echo $this->renderPosition('smi', array('style' => 'block')); ?></div>
<?php endif; ?>
<?php if ($this->checkPosition('lid')) : ?>
<div class="uk-width-1-1" style="font-family: arial; margin-bottom: 3px; font-size: 12px; line-height: 15px;">
    <?php echo $this->renderPosition('lid', array('style' => 'block')); ?></div>
<?php endif; ?>
 
<?php if ($this->checkPosition('links')) : ?>
<div class="item-image" style="padding: 3px;position: absolute;bottom: 1%;right: 1%;">
	<?php echo $this->renderPosition('links', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>

Т.е., использовал такую модифицированную конструкцию, плюс вместо айди категории  -- нужный пункт меню поставил.

 

<?php 
$itemid = JRequest::getInt('Itemid');
if($itemid == '151'):  ?>
 
// вывод для видеогалереи
 
<?php else: // Показ других позиций тизера в остальных пунктах меню ?>
 
//вывод в остальных пунктах меню
 
<?php endif; ?>
 
Спасибо за "пинок"!!
Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 2

#1 Шингисович

Шингисович

Отправлено 12 July 2015 - 16:17


Пробовал сделать как здесь: http://forum.jbzoo.c...prinadlezhnost/-- отдельный вывод тизера для видеогалереи с айди 11, и другой вывод тизера для остальных категорий.

Но не получается.

Что делаю не так?

JBZoo 2.2 rev2823, Joomla 3..4.3

<?php
/**
 * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
 *
 * @package     jbzoo
 * @version     2.x Pro
 * @author      JBZoo App http://jbzoo.com
 * @copyright   Copyright (C) JBZoo.com,  All rights reserved.
 * @license     http://jbzoo.com/license-pro.php JBZoo Licence
 * @coder       Denis Smetannikov <denis@jbzoo.com>
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

$align = $this->app->jbitem->getMediaAlign($item, $layout); 
?>
<?php 
$categoryId = $this->app->jbrequest->getSystem('category');
if ($categoryId == 11) (
    <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('image'); ?>
    </div>
<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
</div>
<div class="item-image" style="font-family: arial; position: absolute; left: 15px; bottom: 15px; z-index: 100; float:left; font-size: 13px; line-height: 15px; color: #598D9E;">
	<?php echo $this->renderPosition('media'); ?></div>
} if($category){

<div class="uk-grid uk-grid-collapse block-divider" style="margin-bottom: 0px;"> 
<div class="uk-width-2-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('image')) : ?>
    <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('image'); ?>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('text')) : ?>
<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
<?php if ($this->checkPosition('media')) : ?>
<div class="item-image" style="font-family: arial; position: absolute; left: 15px; bottom: 15px; z-index: 100; float:left; font-size: 13px; line-height: 15px; color: #598D9E;">
	<?php echo $this->renderPosition('media'); ?></div>
<?php endif; ?>
<div class="uk-width-4-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('title')) : ?>
    <h4 class="item-title" style="font-family: arial; font-size: 13px; line-height: 16px; letter-spacing: 0px; margin-bottom: 5px;">
	<?php echo $this->renderPosition('title'); ?></h4>   
<?php endif; ?>
<?php if ($this->checkPosition('properties')) : ?>
    <div class="item-properties">
        <ul class="uk-list uk-list-line">
            <?php echo $this->renderPosition('properties', array('style' => 'list')); ?>
        </ul>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('smi')) : ?>
<div class="uk-width-1-1 uk-text-truncate" style="font-family: arial; margin-bottom: 20px; font-weight: bolder; color: #9B9B9B;">
    <?php echo $this->renderPosition('smi', array('style' => 'block')); ?></div>
<?php endif; ?>
<?php if ($this->checkPosition('lid')) : ?>
<div class="uk-width-1-1" style="font-family: arial; margin-bottom: 3px; font-size: 12px; line-height: 15px;">
    <?php echo $this->renderPosition('lid', array('style' => 'block')); ?></div>
<?php endif; ?>

<?php if ($this->checkPosition('links')) : ?>
<div class="item-image" style="padding: 3px;position: absolute;bottom: 1%;right: 1%;">
	<?php echo $this->renderPosition('links', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
</div>
}?>


  • 0

Делаю сайты в Казахстане, Астане, webmarka.kz


#2 SmetDenis

SmetDenis

Отправлено 13 July 2015 - 10:31

Но не получается. Что делаю не так?

А что именно не получается? Ошибка? выводит не то... ?


В первую очередь вижу что у вас проблема с синтаксисом.
dzh2_200x0.png
Это грозит как минимум фатальной ошибкой
  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#3 Шингисович

Шингисович

Отправлено 13 July 2015 - 18:21   Лучший Ответ

Это грозит как минимум фатальной ошибкой

Вы правы. Синтаксис неправильный был.

Заменил на другой вывод. Все получилось :)) :

<?php
/**
 * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
 *
 * @package     jbzoo
 * @version     2.x Pro
 * @author      JBZoo App http://jbzoo.com
 * @copyright   Copyright (C) JBZoo.com,  All rights reserved.
 * @license     http://jbzoo.com/license-pro.php JBZoo Licence
 * @coder       Denis Smetannikov <denis@jbzoo.com>
 */
 
// no direct access
defined('_JEXEC') or die('Restricted access');
 
$align = $this->app->jbitem->getMediaAlign($item, $layout); 
?>
<?php 
$itemid = JRequest::getInt('Itemid');
if($itemid == '151'):  ?>
<div class="uk-grid uk-grid-collapse" style="margin-bottom: 0px;">
<div class="uk-width-6-6 uk-grid-collapse" style="">
   <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('video'); ?>
    </div>
	<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
<div class="uk-icon-button" style="font-family: arial; position: absolute;   right: 40px; top: 20px; z-index: 100; color: #598D9E;">
	<?php echo $this->renderPosition('media'); ?></div>
	</div>
	<div class="uk-width-6-6 uk-grid-collapse" style="">
    <h4 class="item-title" style="font-family: arial; font-size: 13px; line-height: 16px; letter-spacing: 0px; margin-bottom: 5px;">
	<?php echo $this->renderPosition('title'); ?></h4> 
		</div>
		</div>
<?php else: // Показ позиции в остальных пунктах меню ?>
 
<div class="uk-grid uk-grid-collapse block-divider" style="margin-bottom: 0px;"> 
<div class="uk-width-2-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('image')) : ?>
    <div class="item-image uk-align-<?php echo $align; ?>">
        <?php echo $this->renderPosition('image'); ?>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('text')) : ?>
<div class="uk-badge uk-badge-danger" style="font-family: arial; position: absolute; left: 15px; top: 15px;">
	<?php echo $this->renderPosition('text', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
<div class="uk-width-4-6 uk-grid-collapse" style="">
<?php if ($this->checkPosition('title')) : ?>
    <div class="item-image" style="font-family: arial; float:left; font-size: 13px; line-height: 15px; color: #598D9E; padding-right: 3px;">
	<?php echo $this->renderPosition('media'); ?></div><h4 class="item-title" style="font-family: arial; font-size: 13px; line-height: 16px; letter-spacing: 0px; margin-bottom: 5px;">
	<?php echo $this->renderPosition('title'); ?></h4>   
<?php endif; ?>
<?php if ($this->checkPosition('properties')) : ?>
    <div class="item-properties">
        <ul class="uk-list uk-list-line">
            <?php echo $this->renderPosition('properties', array('style' => 'list')); ?>
        </ul>
    </div>
<?php endif; ?>
<?php if ($this->checkPosition('smi')) : ?>
<div class="uk-width-1-1 uk-text-truncate" style="font-family: arial; margin-bottom: 20px; font-weight: bolder; color: #9B9B9B;">
    <?php echo $this->renderPosition('smi', array('style' => 'block')); ?></div>
<?php endif; ?>
<?php if ($this->checkPosition('lid')) : ?>
<div class="uk-width-1-1" style="font-family: arial; margin-bottom: 3px; font-size: 12px; line-height: 15px;">
    <?php echo $this->renderPosition('lid', array('style' => 'block')); ?></div>
<?php endif; ?>
 
<?php if ($this->checkPosition('links')) : ?>
<div class="item-image" style="padding: 3px;position: absolute;bottom: 1%;right: 1%;">
	<?php echo $this->renderPosition('links', array('style' => 'pipe')); ?></div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>

Т.е., использовал такую модифицированную конструкцию, плюс вместо айди категории  -- нужный пункт меню поставил.

 

<?php 
$itemid = JRequest::getInt('Itemid');
if($itemid == '151'):  ?>
 
// вывод для видеогалереи
 
<?php else: // Показ других позиций тизера в остальных пунктах меню ?>
 
//вывод в остальных пунктах меню
 
<?php endif; ?>
 
Спасибо за "пинок"!!

Сообщение отредактировал Шингисович: 13 July 2015 - 18:23

  • 1

Делаю сайты в Казахстане, Астане, webmarka.kz






Темы с аналогичным тегами тизер, тип элемента

Click to return to top of page in style!