[SOLVED] Title news detail page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

[SOLVED] Title news detail page

Post by giapippo »

Hello everyone
I have a strange problem with the page titles news
the problem is not 'never occurred in the other sites I've made

for example this web page
http://www.maxoro.it/news/13/58/Rolex-Submariner

does not have the correct title.


in the template of the detail page news use this string
<title>Orologio {if isset($pagetitle)}{$pagetitle}{else}{/if} usato o di secondo polso a Mantova</title>

but the page title " ROLEX SUBMARINER " not loaded

I used this code on other sites and it has always worked
I do not understand

thanks
Last edited by giapippo on Mon Jul 28, 2014 8:40 am, edited 3 times in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Title news detail page

Post by velden »

Do you set $pagetitle in News Detail Template? Because that's required in this case.

Example:

Code: Select all

{assign var='pagetitle' value=$entry->title}
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: Title news detail page

Post by giapippo »

;D
thanks
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: Title news detail page

Post by giapippo »

Unfortunately, something is not right
the actual title of the page is this:
OMEGA SPEEDMASTER PROFESSIONAL

but the page automatically takes this
<title> Rolex Submariner used or second pulse in Mantua </ title>

unfortunately 'but the system takes an OMEGA ROLEX


page template
<title>Orologio {if isset($pagetitle)}{$pagetitle}{else}{/if} usato o di secondo polso a Mantova</title>

and news detail page
{assign var='pagetitle' value=$entry->title}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}


<div id="page-title">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 id="NewsPostDetailTitle">{$entry->title|cms_escape:htmlall} </h2>
</div>
</div>
</div>
</div>



because the title is crazy
thanks
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Title news detail page

Post by velden »

Sorry, but I don't understand what you're trying to say or ask.

Note: make sure to be clear about using a 'page (template)' or a 'module template':
and news detail page
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: Title news detail page

Post by giapippo »

ok
news model Detail in news section

{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{assign var='pagetitle' value=$entry->title}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}


<div id="page-title">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 id="NewsPostDetailTitle">{$entry->title|cms_escape:htmlall} </h2>
</div>
</div>
</div>
</div>





template for Default page to use for detailed views news

<title>Orologio {if isset($pagetitle)}{$pagetitle}{else}{/if} usato o di secondo polso a Mantova</title>
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: Title news detail page

Post by giapippo »

I may have solved this inserndo head that I took from a site that I had developed a month ago


{strip}
{process_pagedata}

{* With cms_lang_info we retrieve current language information, assign gives us $nls variable we can work with *}
{cms_lang_info assign='nls'}

{* using strip as we don't want useless whitespace, especially not before doctype *}
{/strip}<!doctype html>
<__html lang='{$nls->htmlarea()}' dir='{$nls->direction()}'>
<head>
<title>{if isset($pagetitle)}{$pagetitle}{else}{sitename} - {sitename} - {title}{/if}</title>
{metaog key_number=12 key_density=2 desc_length=300 pagedetail=81}
<meta charset='{$nls->encoding()}'>

<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0 user-scalable=no' />
<meta name='HandheldFriendly' content='true' />
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: Title news detail page

Post by giapippo »

ok all work fine
thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: [SOLVED] Title news detail page

Post by Dr.CSS »

Post Reply

Return to “Modules/Add-Ons”