Jump to content


Photo
- - - - -

Разный Description в пагинации


Best Answer Cheren-dow , 13 October 2015 - 20:38

RK3DNP, установка description аналагична установки title - это решение было описанно в соседнем топике.  В случаее с описанием будет следующий код:

$document = JFactory::getDocument();
if ($this->app->jbrequest->get('page')) {
    $metaDesc = $document->getDescription() . ' страница ' . $this->app->jbrequest->get('page');
    $document->setMetaData('description', $metaDesc);
}
Go to the full post


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

#1 RK3DNP

RK3DNP
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 476
  • topics: 128

Posted 08 October 2015 - 15:15

В продолжении прошлой темы, а как еще Description сделать? Там же пишу, не работает.

<?php 
		$page = JRequest::getVar('page');
		
		if ($page) {
			$page = " Страница ".$page;
		}
		
		if ((int)$vars['params']->get('template.category_teaser_text', 1) && $vars['params']->get('content.category_teaser_text', '') && !$page) : ?>
            <div class="description-teaser">
                <?php echo $vars['params']->get('content.category_teaser_text', ''); ?>
            </div>
        <?php endif; ?>


  • 0

#2 Cheren-dow

Cheren-dow
  • JBZoo User (rus)
  • User rate: 95.7
  • posts: 5060
  • topics: 31

Posted 09 October 2015 - 09:59

RK3DNP, это можно сделать по аналогии с данным топиком. Только проверять какая страница используя

if ($this->app->jbrequest->get('page') == 1) {

} elseif ($this->app->jbrequest->get('page') == 2) {

}

  • 0
Изображение
 

#3 RK3DNP

RK3DNP
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 476
  • topics: 128

Posted 10 October 2015 - 14:15

Сейчас у меня в дескрипшине выводит Страница 2, Страница 3... А как вывести перед этим еще и Дескрипшен со страницы 1? Он берется из ZOO

        <?php 
		$document = JFactory::getDocument();
	if ($this->app->jbrequest->get('page') == 1) {
 
} elseif ($this->app->jbrequest->get('page') >= 2) {
 $document->setMetadata('description',  ' Страница ' . $this->app->jbrequest->get('page'));
}
		
		if ((int)$vars['params']->get('template.category_teaser_text', 1) && $vars['params']->get('content.category_teaser_text', '')) : ?>
            <div class="description-teaser">
                <?php echo $vars['params']->get('content.category_teaser_text', ''); ?>
            </div>
        <?php endif; ?>

  • 0

#4 RK3DNP

RK3DNP
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 476
  • topics: 128

Posted 13 October 2015 - 17:55

Вопрос так и не решен. Подскажите пожалуйста что дописать, чтобы на 2 и далее страницы так же подставлялся и дескрипшен из 1ой


  • 0

#5 Cheren-dow

Cheren-dow
  • JBZoo User (rus)
  • User rate: 95.7
  • posts: 5060
  • topics: 31

Posted 13 October 2015 - 20:38   Best Answer

RK3DNP, установка description аналагична установки title - это решение было описанно в соседнем топике.  В случаее с описанием будет следующий код:

$document = JFactory::getDocument();
if ($this->app->jbrequest->get('page')) {
    $metaDesc = $document->getDescription() . ' страница ' . $this->app->jbrequest->get('page');
    $document->setMetaData('description', $metaDesc);
}

  • 0
Изображение
 

#6 RK3DNP

RK3DNP
  • Topic Starter
  • JBZoo User (rus)
  • User rate: 0.5
  • posts: 476
  • topics: 128

Posted 14 October 2015 - 08:25

спасибо большое.


  • 0




Click to return to top of page in style!