Page 1 of 1

Dynamic Site description

PostPosted: 11 Dec 2012, 21:39
by Drubilar
have you considered using the description of the lists to use as "site description"?
as attached screenshot, all lists are of the same description, to have a dynamic site description consistent with the content increase the pagerank :)

Re: Dynamic Site description

PostPosted: 12 Dec 2012, 09:09
by Xpycm
Please, open the protected\modules\apartments\views\view.php file.

In the top of the file, after the line:
Code: Select all
$this->pageTitle .= ' - '.$model->getStrByLang('title'); 

you should add:
Code: Select all
if ($model->getStrByLang('description'))
    $this->pageDescription = truncateText($model->getStrByLang('description'), 20); 


This action will allow you to specify the first 20 words from the “Description” field of the listing in meta name="description"

Re: Dynamic Site description

PostPosted: 12 Dec 2012, 16:59
by flashvm
thanks,for the news and faq ?

/protected/modules/news/views/view.php
/protected/modules/articles/views/view.php

tried to put there,but does not go, tell me?

Re: Dynamic Site description

PostPosted: 12 Dec 2012, 17:20
by Xpycm
In /protected/modules/news/views/view.php file:
Code: Select all
if ($model->getStrByLang('body'))
    
$this->pageDescription truncateText($model->getStrByLang('body'), 20);  


and in /protected/modules/articles/views/view.php file:
Code: Select all
if ($model->getStrByLang('page_body'))
    
$this->pageDescription truncateText($model->getStrByLang('page_body'), 20);