news sub categories with wrong template in search engine

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

news sub categories with wrong template in search engine

Post by pierrepercee »

Hello,

The link to read a full news (global news template) is :

Code: Select all

http://monsite.fr/news/124/12/objet-essai-livre/d,tempobjets.html
So far so good.

Except that if you search some articles on Google by example you will find:

Code: Select all

http://monsite.fr/news/124/14/objet-essai-livre.html
The item number is the right (124 passed as a parameter in the URL), the page template associated to this news changes (here 14 instead of 12).
The template is then used (is it a coincidence ...?) the default template.

I don't know why there's two differents urls. It should be exactly the same... ::)
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: news sub categories with wrong template in search engine

Post by Jeff »

Make sure you are setting the canonical URL https://support.google.com/webmasters/a ... 9066?hl=en

It should be the URL coming from the module and not the URL of the page, some how google is getting to the page with a different URL.
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

Hello,

Multiple ways (urls) to access one page is not good for SEO purpose. But in this case the page template (not the news detail template) changes.

I try to use Canonical URl this way:

In the news detail template:

Code: Select all

{if isset($entry->canonical)}
  {assign var='canonical' value=$entry->canonical}
{/if}
In the page template:

Code: Select all

{if isset($canonical)}<link rel='canonical' href='{$canonical}' />{elseif isset($content_obj)}<link rel='canonical' href='{$content_obj->GetURL()}' />{/if}
It works so well : the canonical url I found in the source code is the wrong... ::)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: news sub categories with wrong template in search engine

Post by Dr.CSS »

Are you by chance using a summary or detail template call in the {news} tag..?
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

Hello,

an example here(fresh install 1.11.11) :
example

I have a specific page to display this news category (alias page = "page-appel" with template="simplexbis")
The "by default" page set in news options for "detailnewstemplate" is " page-appel-news-defaut" with Simplex template.

Canonical URL and rewrite URL OK.

I call the "detailtemplatepage" (homepage with Simplex) with this call:
{news summarytemplate='Summary_Simplex' number='2' detailpage='page-appel' detailtemplate='detailtest'}

First, the url called on frontside is:

Code: Select all

http://www.formation-adhoc.com/news/2/57/testurltitre/d,detailtest.html
Nota : "d,detailtest.html"
In the source code canonical URL is:
http://www.formation-adhoc.com/news/2/5 ... titre.html

This Url do not give the right template (simplexbis) but the default template(simplex) for the page.
It's obvious there's a bug !There is a serious problem. This bug prevents Google properly index the pages concerned...
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: news sub categories with wrong template in search engine

Post by JohnnyB »

the different urls are there because the news tag where you see the summary articles may not have the correct detail page parameter assigned.

Those different digits represent different content page IDs. So, to keep it consistent, make sure all of the news tags have consistent parameters set.

I don't rely on the News setting for the detail page and set it each time in the tag. I think that may be the result of the URL format you see as well.
Personally, I wouldn't want this: http://www.formation-adhoc.com/news/2/5 ... ltest.html

so, setting the detail page param in the tag that is showing the news summaries (links) should fix that.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

Hello,

Thanks but i 'm afraid I don't understand your answer.

As you can read he call for news in the Homepage is :

Code: Select all

{news summarytemplate='Summary_Simplex' number='2' detailpage='page-appel' detailtemplate='detailtest'}
As you can see there's nothing wrong here !
I set the right "detail page" witch is not the "By default" page for "news detailtemplate" and i set the right "newsdetailtemplate" witch is not the "By default" but "detailtest" news detail template.

Canonical Url do not match the front side url... More than that with the canonical URL, the "newsdetailtemplate" returned is not the good one witch is in the call but the "bydefault" newsdetailtemplate.

the canonical URL mechanism does not seem to use someof witch are essential parameters.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: news sub categories with wrong template in search engine

Post by JohnnyB »

What tag do use on the detail page?
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

No tag in the detail page called !
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: news sub categories with wrong template in search engine

Post by JohnnyB »

pierrepercee wrote:No tag in the detail page called !
I usually place a news tag on the detail page... dunno if that will help you.


My other suggestion is to not use the modules detail page setting option.
Only use the detailpage parameter in the tag. I think that works better and wonder if setting it in the module options makes the tag parameter ignored.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

Sorry but I already tried: none of these solutions works...
if version 2.0 is to be published during 2015, I think that a fix should be considered for the 1.11.12.
Everyone knows that version 2.0 will be early adopted by the most intrepid webmasters. The others will wait a few months ... ;)
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: news sub categories with wrong template in search engine

Post by JohnnyB »

Then, there is something else happening that is causing this behavior that is specific to the installation or setup. I have News running in several sites in CMSMS 1.11.x and this doesn't happen at all.

In some installations, I have {News} where I want my summaries
And {News} in my detail page with the "Default page to use for detail views" set to my detail page -- usually this has an alias of "news"

In other installations, I have {News detailpage="news"} where I want summaries with the {News} tag on the detail page without setting the "Default page to use for detail views" option.

Both scenarios work correctly and generate consistent URLs for the article links and canonical links.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
pierrepercee
Forum Members
Forum Members
Posts: 150
Joined: Thu Jan 10, 2013 8:02 am

Re: news sub categories with wrong template in search engine

Post by pierrepercee »

I'm sorry, but the scenario mentioned is not the one I mentioned. In this particular case, which does not correspond to a marginal or exotic use, the system does not work properly, on a standard hosting with a fresh install. :-\
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: news sub categories with wrong template in search engine

Post by JohnnyB »

pierrepercee wrote:I'm sorry, but the scenario mentioned is not the one I mentioned. In this particular case, which does not correspond to a marginal or exotic use, the system does not work properly, on a standard hosting with a fresh install.
I don't understand what your last reply means. I haven't found a situation where it doesn't work properly on standard hosting and a fresh install unless there is a server, cmsms install, or news tag/setting problem.
pierrepercee wrote:

Code: Select all

http://monsite.fr/news/124/12/objet-essai-livre/d,tempobjets.html

Code: Select all

http://monsite.fr/news/124/14/objet-essai-livre.html
The item number is the right (124 passed as a parameter in the URL), the page template associated to this news changes (here 14 instead of 12).
The fact that there is a URL with '12' and another with '14' indicates that your news tags or news settings are not configured correctly because those are the ID #s of the pages being selected as the article's landing page.

So, somewhere, you have a page with a news tag that wants to open the article on the page alias with content_id 12 and another link somewhere that wants the article to open in the page with content_id 14.

This is why Google is indexing different pages than you expect.

Look at the list of content pages in your Admin. Hover over each edit page link and then look at the content_id in the URL. Then, look at the pages for content_id 12 and 14 -- these are being assigned as detail pages, somewhere. Either in the News module settings, or the news module tag.

Compare that to your news tags and news settings to be sure you have the detail page aliases set up they way you want.

There have been situations where someone creates a page with an alias called "news" and the News module wants to use that page by default even though it is not being asked to do so. However, I think that was cleared up several version ago.

Another area to check is the "Routes" in the Site Maintenance screen.


Also, verify that mod_rewrite set up correctly on the server and set up correctly in the .htaccess file and config.php.

By the way, I don't recall seeing news links like this in any of the sites I've built:
monsite.fr/news/124/12/objet-essai-livre/d,tempobjets.html
since I started using CMSMS back in 2006 which seems like a red flag to me. But, perhaps I just never noticed...
Last edited by JohnnyB on Wed Dec 10, 2014 8:28 pm, edited 1 time in total.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: news sub categories with wrong template in search engine

Post by Dr.CSS »

Because you call the detailtemplate in the {tag} you get the d in the url, set the detail template as default in News and it should go away...
Post Reply

Return to “The Lounge”