Jump to content


Photo
- - - - -

Не выводит названия товаров

title

Best Answer zeus07 , 28 December 2015 - 21:10

Попробуйте заменить строку: 

  1. $document->setTitle(strip_tags(trim($this->renderPosition('meta-title'))));

На эту: 

  1. $document->setTitle(strip_tags(trim($this->renderPosition('title'))));

В этом случае по идее оно будет брать title сразу автоматом из названия товара.

Go to the full post


  • This topic is locked This topic is locked
18 replies to this topic

#11 laRus

laRus
  • JBZoo User (rus)
  • User rate: 60
  • posts: 1334
  • topics: 31

Posted 28 December 2015 - 19:02

topins, on 28 Dec 2015 - 17:46, said:

Может какие настройки JBZoo влияют на эти стили
Это не могу, к сожалению, с ходу сказать! Надо разбираться. Но никто еще, кажется, о таких проблемах тут не говорил..
  • 0
..minimum effort for maximum effect? - Oh yeah! It's good!..

#12 topins

topins
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.3
  • posts: 369
  • topics: 56

Posted 28 December 2015 - 19:24

Ursa, on 28 Dec 2015 - 18:02, said:

Это не могу, к сожалению, с ходу сказать! Надо разбираться. Но никто еще, кажется, о таких проблемах тут не говорил..

Думаю тем "интереснее" будет решение. Жду помощи других форумчан.


  • 0

#13 alexmixaylov

alexmixaylov
  • JBZoo User (rus)
  • User rate: 7.7
  • posts: 679
  • topics: 142

Posted 28 December 2015 - 19:36

display: none

влияет только на отображение материала

 

это свойство только Скрывает элемент

 у вас в коде тайтл отсутствует вообще

так что не обращайте на это внимание

 

попробуйте задать для материала в метаданных какое то НАЗВАНИЕ

и проверьте выводит ли эту надпись в тайтл

 

joxi_screenshot_1451327573014.png

 

Тайтл формируется автоматом, если пусто в метаданных, берет из названия


  • 0

#14 topins

topins
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.3
  • posts: 369
  • topics: 56

Posted 28 December 2015 - 19:41

'alexmixaylov', on 28 Dec 2015 - 18:36, said:

Тайтл формируется автоматом, если пусто в метаданных, берет из названия

 

Вот это то меня и смущает, что все везде есть - а не выводит. Мистика блин

 

screenshot (1).png  screenshot.png

 

При чем, не показывает именно в позиции Full. Названия в тизере показывает как нужно


Edited by topins, 28 December 2015 - 19:43.

  • 0

#15 i001

i001
  • JBZoo User (rus)
  • User rate: 46.4
  • posts: 972
  • topics: 76

Posted 28 December 2015 - 19:58

Возможно вы переопределяли title в full.php?

посмотрите есть ли там что нибудь типа :

  1. setMetadata('title', ....

Если нет, как вариант попробуйте title задавать именно там

  1. $title = JFactory::getDocument();
  2. $title->setMetadata('title', $this->renderPosition('title'));

А вообще мистика, не встречал еще такого...


  • 0

#16 topins

topins
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.3
  • posts: 369
  • topics: 56

Posted 28 December 2015 - 20:20

Да, по ходу дело в коде шаблона Full. Он сейчас так выглядит

  1. <?php
  2. /**
  3. * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
  4. *
  5. * @package jbzoo
  6. * @version 2.x Pro
  7. * @author JBZoo App http://jbzoo.com
  8. * @copyright Copyright (C) JBZoo.com, All rights reserved.
  9. * @license http://jbzoo.com/license-pro.php JBZoo Licence
  10. * @coder Denis Smetannikov <denis@jbzoo.com>
  11. */
  12.  
  13. // no direct access
  14. defined('_JEXEC') or die('Restricted access');
  15. $document = JFactory::getDocument();
  16. $document->setMetadata('description', strip_tags(trim($this->renderPosition('meta-description'))));
  17. $document->setMetadata('keywords', strip_tags(trim($this->renderPosition('meta-keywords'))));
  18. $document->setTitle(strip_tags(trim($this->renderPosition('meta-title'))));
  19.  
  20. $align = $this->app->jbitem->getMediaAlign($item, $layout);
  21. $tabsId = uniqid('jbzoo-tabs-');
  22.  
  23. echo $this->renderPosition('title', array('style' => 'jbtitle'));
  24. echo $this->renderPosition('subtitle', array('style' => 'jbsubtitle'));
  25. echo $this->renderPosition('likes', array('style' => 'jbblock', 'class' => 'align-left'));
  26. echo $this->renderPosition('rating', array('style' => 'jbblock', 'class' => 'align-right'));
  27.  
  28. ?>
  29. <div class="clear clr"></div>
  30.  
  31. <div class="rborder item-body">
  32.  
  33. <?php if ($this->checkPosition('image')) : ?>
  34. <div class="item-image align-<?php echo $align; ?>"><?php echo $this->renderPosition('image'); ?></div>
  35. <?php endif; ?>
  36.  
  37. <?php if ($this->checkPosition('anons')) : ?>
  38. <div class="item-anons"><?php echo $this->renderPosition('anons'); ?></div>
  39. <?php endif; ?>
  40.  
  41. <?php if ($this->checkPosition('meta')) : ?>
  42. <hr/>
  43. <div class="item-meta">
  44. <?php echo $this->renderPosition('meta', array('style' => 'jbblock', 'labelTag' => 'strong', 'tag' => 'p')); ?>
  45. </div>
  46. <?php endif; ?>
  47. <div class="clear clr"></div>
  48. </div>
  49.  
  50. <?php if ($this->checkPosition('meta')) : ?>
  51. <?php echo $this->renderPosition('social', array('style' => 'jbblock')); ?>
  52. <?php endif; ?>
  53.  
  54. <div class="clear clr"></div>
  55.  
  56. <?php if ($this->checkPosition('tab-text')
  57. || $this->checkPosition('tab-gallery')
  58. || $this->checkPosition('tab-properties')
  59. || $this->checkPosition('tab-reviews')
  60. || $this->checkPosition('tab-comments')
  61. ) :
  62.  
  63. $positionParams = array(
  64. 'style' => 'jbblock',
  65. 'tag' => 'div',
  66. 'labelTag' => 'h3',
  67. 'clear' => true
  68. );
  69.  
  70. ?>
  71. <div id="<?php echo $tabsId; ?>" class="rborder">
  72. <ul>
  73. <?php if ($this->checkPosition('tab-text')) : ?>
  74. <li>
  75. <a href="#tab-text"><?php echo JText::_('JBZOO_ITEM_TAB_DESCRIPTION'); ?></a>
  76. </li>
  77. <?php endif; ?>
  78.  
  79. <?php if ($this->checkPosition('tab-properties')) : ?>
  80. <li>
  81. <a href="#tab-properties"><?php echo JText::_('JBZOO_ITEM_TAB_PROPS'); ?></a>
  82. </li>
  83. <?php endif; ?>
  84.  
  85. <?php if ($this->checkPosition('tab-gallery')) : ?>
  86. <li>
  87. <a href="#tab-gallery"><?php echo JText::_('JBZOO_ITEM_TAB_GALLERY'); ?></a>
  88. </li>
  89. <?php endif; ?>
  90.  
  91. <?php if ($this->checkPosition('tab-reviews')) : ?>
  92. <li>
  93. <a href="#tab-reviews"><?php echo JText::_('JBZOO_ITEM_TAB_REVIEWS'); ?></a>
  94. </li>
  95. <?php endif; ?>
  96.  
  97. <?php if ($this->checkPosition('tab-comments')) : ?>
  98. <li>
  99. <a href="#tab-comments"><?php echo JText::_('JBZOO_ITEM_TAB_COMMENTS'); ?> (<?php echo $item->getCommentsCount(); ?>)</a>
  100. </li>
  101. <?php endif; ?>
  102. </ul>
  103.  
  104. <?php if ($this->checkPosition('tab-text')) : ?>
  105. <div id="tab-text"><?php echo $this->renderPosition('tab-text', $positionParams); ?></div>
  106. <?php endif; ?>
  107.  
  108. <?php if ($this->checkPosition('tab-properties')) : ?>
  109. <div id="tab-properties">
  110. <table class="jbtable table zebra">
  111. <?php echo $this->renderPosition('tab-properties', array('style' => 'jbtable')); ?>
  112. </table>
  113. </div>
  114. <?php endif; ?>
  115.  
  116. <?php if ($this->checkPosition('tab-gallery')) : ?>
  117. <div id="tab-gallery"><?php echo $this->renderPosition('tab-gallery', $positionParams); ?></div>
  118. <?php endif; ?>
  119.  
  120. <?php if ($this->checkPosition('tab-reviews')) : ?>
  121. <div id="tab-reviews"><?php echo $this->renderPosition('tab-reviews', $positionParams); ?></div>
  122. <?php endif; ?>
  123.  
  124. <?php if ($this->checkPosition('tab-comments')) : ?>
  125. <div id="tab-comments"><?php echo $this->renderPosition('tab-comments', $positionParams); ?></div>
  126. <?php endif; ?>
  127. </div>
  128.  
  129. <?php $this->app->jbassets->tabs(); ?>
  130. <script type="text/javascript">
  131. jQuery(function ($) {
  132. $('#<?php echo $tabsId;?>').JBZooTabs({
  133. onTabShow: function (index) {
  134. var map = $('.googlemaps > div:first');
  135. if (map.length) {
  136. map.data('Googlemaps').refresh();
  137. }
  138. }
  139. });
  140. });
  141. </script>
  142.  
  143. <?php endif; ?>
  144.  
  145. <?php echo $this->renderPosition('related', array('style' => 'jbblock', 'labelTag' => 'h2', 'clear' => true)); ?>
  146.  

Поскажите, куда вставить конструкцию (или как то иначе):

  1. <?php if ($this->checkPosition('title')) : ?>
  2. <h1 class="item-title"><?php echo $this->renderPosition('title'); ?></h1>
  3. <?php endif; ?>

Что бы все заработало? Возможно, как то накосячил с этим рецептом...


Edited by topins, 28 December 2015 - 20:24.

  • 0

#17 zeus07

zeus07
  • JBZoo User (rus)
  • User rate: 6.6
  • posts: 1090
  • topics: 172

Posted 28 December 2015 - 21:10   Best Answer

Попробуйте заменить строку: 

  1. $document->setTitle(strip_tags(trim($this->renderPosition('meta-title'))));

На эту: 

  1. $document->setTitle(strip_tags(trim($this->renderPosition('title'))));

В этом случае по идее оно будет брать title сразу автоматом из названия товара.


  • 3

#18 topins

topins
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.3
  • posts: 369
  • topics: 56

Posted 28 December 2015 - 21:25

Благодарствую, все работает!


  • 0

#19 zeus07

zeus07
  • JBZoo User (rus)
  • User rate: 6.6
  • posts: 1090
  • topics: 172

Posted 28 December 2015 - 21:27

Да не за что, всегда пожалуйста)


  • 1





Click to return to top of page in style!