• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC


Forum rules


Only administrators can post or move items here.



Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: News : Use SLUG prevent use of specified detail template
PostPosted: Thu Jul 30, 2015 12:23 pm 
Offline
Forum Members
Forum Members

Joined: Thu Jan 10, 2013 8:02 am
Posts: 44
When you add SLUG (often for SEO purpose) to a News, the news template details called in your template is ignored for the by default template.

Anymore, Canonical URL doesn't take care about the specified template details called in your template. It use the by default template details-

But if you don't use SLUG :
Real Url generated (click on "More" on front-end to read the entire news):
\$1:
http://localhost/rc1/news/1/24/News-Module-Installed/d,simpletest.html

Canonical URL generated (just the news page...) :
\$1:
 <link rel='canonical' href='http://localhost/rc1/default-extensions/modules/news.html' />


I remember this topic


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 9:05 am 
Offline
Forum Members
Forum Members

Joined: Thu Jan 10, 2013 8:02 am
Posts: 44
For end customers, those who buy sites, this problem is hardly visible. Yet this inevitably leads to significant shortfalls for the affected sites.
The url rewriting and management of canonical url are, in my view, very important for SEO ... I know that developers do a lot of work, all for free, but I think this problem should be solved for 1.12 and 2.0 version. Simple to say...I know this. I do my best to point out the important points.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 10:42 am 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 3121
Location: The Netherlands
I'm not sure what exactly the problem is. You can/should set the canonical url yourself from the News detail template. You posted this yourself in viewtopic.php?p=317843#p317843

Further, perhaps this information is useful to know:

CGExtension module has some extra functionality (from help):

\$1:
{cge_module_hint module=string ...}

This function plugin can be used to provide hints for module behavior if various parameters cannot be specified on the URL. I.e: In a situation when a site is configured to use pretty urls for SEO purposes it is often impossible to provide additional module parameters like a detailtemplate or sort order on a URL. This plugin can be used in page templates, GCBs or in a page specific way to give hints as to how modules should behave.

Note: Any parameters that are specified on the URL will override matching module hints. i.e: When using News and a detailtemplate parameter is specified on a News detail url, any detailtemplate hints will have no effect.

Note: In order to ensure proper behavior, module hints must be created before the {content} tag is executed in the CMSMS page template. Therefore they should (normally) be created very early in the page template process. An ideal location for page specifc hints is in the "Smarty data or logic that is specific to this page:" textarea on the editcontent form.
Example:

When using the CGBlog module, and pretty urls. You wish to display blog articles for a specific category on one page, and would like to use a non standard detail template to display the individual articles on a differernt page. I.e: perhaps on your "Sports" page you are calling CGBlog like: {CGBlog category=sports detailpage=sports_detail}. However, using pretty urls it is impossible to specify a detailtemplate on the links that will generate the detail views. The solution is to use the {cge_module_hint} tag on the sports_detail page to provide some hints as to how CGBlog should behave on that page.

When editing the sports_detail page on the options tab, in the textarea entitled "Smarty data or logic that is specific to this page:" you could enter a tag such as: {cge_module_hint module=CGBlog detailtemplate=sports}. Now when a user clicks on a link from the CGBlog display on your "sports" page he will be directed to the sports_detail page, and the CGBlog detail template entitled "sports" will be used to display the article.

It is possible to specify multiple parameter hints to a single module in one call to this plugin.
It is possible to call this module multiple times in a request to provide hints to different modules.

Usage:

{cge_module_hint module=CGBlog summarytemplate=something detailpage=home}
{cge_module_hint module=CGSmartImage noembed=1}



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 11:12 am 
Offline
Forum Members
Forum Members

Joined: Thu Jan 10, 2013 8:02 am
Posts: 44
for the next version (2.0), the problem seems to me clearly stated. You can do the test locally. The use of a specific module (CG Extension) is a stopgap.
Many integrators have not identified this problem and do not know this solution. I can provide you with mp sites url's where the problem arises (in 1.12)
This must be managed natively for each module concerned.
Clearly the generation of the canonical url must integrate all the parameters specific to the page. Choosing a template detailed in part, obviously.
If it is possible to examine this, it is in the class.news_article.php file

[removed by moderator]


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 1:30 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8164
Location: Fernie British Columbia, Canada
The problem is: You cannot have a pretty URL AND pass all of the parameters that are possible from a summary view to a detail view on the URL. The two requirements conflict with each other.

CMSMS 2.0 has added the {cms_module_hint} tag to work around the problem in most (but not all) cases.

i.e: even with cms_module_hint you still cannot do some things like have a slug URL and specify a different detail page or detail template per news category if the summary view is displaying all categories.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 8:52 pm 
Offline
Power Poster
Power Poster

Joined: Mon Jan 21, 2008 5:51 pm
Posts: 961
Location: MI
pierrepercee \pierrepercee:
Many integrators have not identified this problem and do not know this solution.

That isn't a problem with CMSms, that is a problem with people thinking they can do something they are not qualified to do and/or are unwilling to learn the software they are using.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 9:54 pm 
Offline
Forum Members
Forum Members

Joined: Thu Jan 10, 2013 8:02 am
Posts: 44
@Jeff

To go from London to Paris you can of course go through Moscow, but everyone does not want to. Argue incompetence of integrators as it is clearly a weakness of CMSMS is a point of view. Perhaps you allow me not to share it.

@Calguy
On the front-end pretty urls work perfectly and pass the detail template as a parametter without a problem. Only the canonical url collected problem.
I naively thought that what had been implemented in pretty urls could be in the canonical url management mechanism. I had to make mistake ...


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Fri Aug 07, 2015 11:05 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8164
Location: Fernie British Columbia, Canada
We will not be changing this.

in fact... we should be removing the /d,detailltemplatename stuff too. That never should've been done, but there was no better solution at the time. However, we'll save that for a later version.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 10:19 am 
Offline
Forum Members
Forum Members

Joined: Tue Oct 21, 2014 12:47 pm
Posts: 103
Location: Lorient (France)
On the French forum there are few people who know about this problem since few of us use different detail templates (http://www.cmsmadesimple.fr/forum/viewtopic.php?id=5737&p=1.

A solution could be to modify the canonical url in class.news_article.php, private function _get_canonical()
replacing
\$1:
[removed by moderator]

by
\$1:
$canonical = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']


An other solution : using a default templace that select the good detail template in function of news category.
\$1:
<!-- Start News Display Template -sélectionne detailpage et detail template en fonction de la catégorie, le dernier article est affiché avec titre image et résumé les autres seulement avec le résumé ->
{$num_article=0}
{$num_article}
{$pagecount}
{if $pagecount > 1}
  <p  style="text-align : center;  margin-bottom : 2px; padding-bottom: 5px; border-bottom : 2px solid #ccc;">
{if $pagenumber > 1}
{$firstpage}&nbsp;&nbsp;{$prevpage}&nbsp;
{/if}
{$pagetext}&nbsp;{$pagenumber}&nbsp;{$oftext}&nbsp;{$pagecount}
{if $pagenumber < $pagecount}
&nbsp;{$nextpage}&nbsp;&nbsp;{$lastpage}
{/if}
</p>
{/if}


{foreach from=$items item=entry}

{* on modifie detailpage en fonction de la catégorie de l'article en paramétrant news*}
{$detail_page="nouvelle"}
{$gabarit_det="actualites"}

{if $entry->category == 'Travaux en cours'}
{$detail_page="travaux-en-cours-detail"}
{$gabarit_det="travaux"}

{elseif $entry->category == 'Techniques 3D'}
{$detail_page="travaux-en-cours-detail"}
{$gabarit_det="travaux"}

{elseif $entry->category == 'actualités'}
{$detail_page="actualite"}
{$gabarit_det="actualites"}

{elseif $entry->category == 'Mise à jour du site'}
{$detail_page="actualite"}
{$gabarit_det="actualites"}

{elseif $entry->category == 'Pédagogie'}
{$detail_page="pedagogie-2"}
{$gabarit_det="travaux"}

{elseif $entry->category == 'musées'}
{$detail_page="musees-details"}
{$gabarit_det="musees"}

{/if}

{if $num_article==0}

{news idlist="{$entry->id}"  summarytemplate="actualites_mini_pop"    detailtemplate="$gabarit_det" detailpage="$detail_page"}
{else}
{news idlist="{$entry->id}"  summarytemplate="actualites_mini_pop_ss_image"    detailtemplate="$gabarit_det" detailpage="$detail_page"}
{/if}

{$num_article=$num_article+1}

{/foreach}

{* fin de la modification *}
<!-- End News Display Template -->


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 11:16 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 1759
archeo \archeo:
A solution could be to modify the canonical url (...) by
\$1:
$canonical = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']
This IS NOT a solution* for the canonical urls as in doesn't specify one single url for the current content and will be dismissed by search engines:
googlewebmastercentral - 5 common mistakes with rel=canonical \googlewebmastercentral - 5 common mistakes with rel=canonical :
Specify no more than one rel=canonical for a page. When more than one is specified, all rel=canonicals will be ignored.
See 5 common mistakes with rel=canonical.

Although there may be issues with the generation of the canonical urls in News (because of an feature that shouldn't exist in the module to begin with, see Calguy 2nd reply) the current discussion and that old topic revolve around a misconception of what canonical URLs really are, and their use (at least imo).

Suggested reading:


pierrepercee \pierrepercee:
The url rewriting and management of canonical url are, in my view, very important for SEO
It's misuse is... being even recommended that better than using it wrongly is not using it at all if you are not sure it is correctly implemented... Just read the links above.
pierrepercee \pierrepercee:
This must be managed natively for each module concerned.
That is partially true... the generation of the correct canonical URL should be a feature in some modules, but:
calguy1000 \calguy1000:
The problem is: You cannot have a pretty URL AND pass all of the parameters that are possible from a summary view to a detail view on the URL. The two requirements conflict with each other.

CMSMS 2.0 has added the {cms_module_hint} tag to work around the problem in most (but not all) cases.

The solution is not a simple one and even other CMS's and applications scripts either have poor solutions for this or none at all from what I could read on some articles. IMO News has a decent, if not perfect, solution.


*P.S.: actually this may have an extremely negative impact on SEO according to the articles from the links I posted.

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).


Code of Conduit | CMSMS Docs
Help Support CMSMS
My developer Page on the Forge | Yet another blog about CMSMS

GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 11:59 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 1759
On another note:
archeo \archeo:
An other solution : using a default templace that select the good detail template in function of news category.
This seems a far better solution for this issue IMnsHO. :)

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).


Code of Conduit | CMSMS Docs
Help Support CMSMS
My developer Page on the Forge | Yet another blog about CMSMS

GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 1:44 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8164
Location: Fernie British Columbia, Canada
I read through (most of) the thread on the French forum and this is because you want to use different news detail templates (and potentially different News detail pages) for different categories of News.

Well, I need to tell you that:
a: This question has been asked and answered many times on our forum, it does not only apply to News but to almost every other module that supports summary/detail views.
b: There is no bug. News is not built out of the box to handle this.

Here is why it is not a bug:
- The News module is capable of displaying a summary of news articles in many ways (different categories, page limits, sort orders, by author, etc.).
- When creating a summary view you can specify a detailpage parameter to use for all links to individual articles coming from that summary view. (does not apply when using SLUG's).
- When using News SLUG's you must specify a single detail page. There is a preference in the news module for this. This is because there is no detail page value on the URL itself to parse out.
- The module allows you to specify (per summary call) that detail links from this summary view should be dispayed on this page. This applies when NOT using slugs. The url is like "news/<pageid>/<articleid>/title-text"
- The module allows you to specify (per summary call) the detail template to use for all detail views coming from this summary view. This applies when NOT using slugs.
- You can create multiple different summary views on different pages (or even the same page). There is a great deal of flexibility in the module. But you can't have everything...... You can't have flexibility AND a single canonical URL for an article.
- If slugs are NOT used {news detailpage=home}{news detailpage=about} would generate two different canonical URL's for the same article (because you specified the detailpage parameter differently)... it is your responsibility to manage this.
i.e: if you dont' care about SEO, you could use {news category=foo detailpage=childcat}{news category=parentcat detailpage=bar}. Which would give you two different detail pages (and therefore potentially two different page templates) depending upon the category.

When not using slugs: This URL: News/22/55/some-news-article.html/d,footemplate
and This URL: News/22/55/some-news-article.html and this URL:
News/25/55/foo-bar.html all point to the same article (55) and therefore will result in duplicate content issues with google. because they are displaying the same data.
The first URL is just a different type of ugly URL than the normal ?cntnt01detailtemplate=footemplate stuff.

You can test this out... even when using slugs. You need to know the ID of any visible content page, AND the id of a valid news article then enter a URL Like <site>/News/<pageid>/<articleid>/some-junk.html it'll work. And you can change the page id or the "some-junk" stuff all you want. When a slug is entered for that article (and you haven't made any other changes). The canonical URL will use the slug.

The 'detailtemplate' parameter (in the summary view) is perhaps our biggest mistake. Although it certainly may have correct uses (can't think of any right now); for what you want, it is not the proper thing to use. If you want a custom display of some data based on the data itself (author, category, dates, depending on whether it has images or not, or the value of some custom field, etc) then the best place to make those decisions is in the detail template itself. Just put logic into your detail template.

Most of us would never think of putting logic in a summary template that says 'if the article author is 'fred' use a different detail template. We would put that display logic into the detail view itself. Then why would we do it for categories. It is best left to the detail view.

i.e:

{if $news_category == 'foo'} .... {else} ... {/if} {* pseudocode *}

is exactly the same type of decision as:

{if $news_image != ''} <!-- display image on left, summary on right --> {else} <!-- display summary across whole row --> {/if} {* pseudocode *}

or

{if $news_author == 'fred'}<!-- this guy is special, display a start with his profile -->{/if}

You can also use smarty logic and the {include} tag to include other templates so that your primary logic occurs in one template, and a nice... clean template does the display. i.e: something like:

{* My default News detail template *}
{if $news_category == 'foo'}
{include file='module_db_tpl:News;foo_category_detail'}
{else}
{include file='module_db_tpl:News;standard_detail'}
{/if}

Woot! I think I've just convinced myself to drop the whole detailtemplate parameter stuff from the summary view in News for CMSMS 2.1 :)

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 3:27 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8164
Location: Fernie British Columbia, Canada
Just as a followup... we have been looking through the code and discussing this, and came up with one good explanation for the way the URL's work specifically related to the News module (but my other modules copy this methodology)

a: There are multiple ways to display a news article, and the same news article can be displayed on different pages with different detail templates.... and therefore you CAN access the same news article via multiple different URL's.

b: For SEO purposes there can only be ONE canonical URL for an article.
For News this is determined by:
i: The slug (if it is set). You must specify the 'default page for detail views' in the News module settings.
ii: If the slug is not set then the 'default page for detail views' is used or the default page id. The detailtemplate parameter or any other parameter is NOT included on the URL.

c: If not using pretty URL's... then we assume that SEO is not a priority (maybe it's an intranet or members only site) and we just 'fake' a canonical URL using whatever parameters were passed to the module action.

So, therefore... if you want to display articles differently, based on some criteria, AND SEO is important to you, then put the logic into your detail template.

Putting the logic into the detail template is the better way from a logical point of view anyways.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sat Aug 08, 2015 5:45 pm 
Offline
Forum Members
Forum Members

Joined: Tue Oct 21, 2014 12:47 pm
Posts: 103
Location: Lorient (France)
Thank you very much to Jo and Calguy for their very detailed answers.
Probably a stupid suggestion , using an url like :
news/<pageid>/<articleid>/<detailtemplateid>/title-text if the parameter detailtemplate is use.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: News : Use SLUG prevent use of specified detail templat
PostPosted: Sun Aug 09, 2015 11:51 pm 
Offline
Forum Members
Forum Members

Joined: Thu Jan 10, 2013 8:02 am
Posts: 44
Hello Calguy and thank you for these welcome clarification.
We can of course offer the same news with different retail templates on different pages.
This obviously raises if one gets the template detail in a canonical url SEO problem. It is right but I think it is very far from being the most frequent case (to be quite honest I think it more to do with a particular purpose)
In most cases different news belonging to different categories are offered on different pages. The problem of a single URL to a single content not then arise.
For against, when not used slugs, Google obviously shows the canonical URL using the default template detail. The result is obvious: users who are looking for information via Google will fall on poorly formatted pages.
I have no ideal solution to offer and I know this is not simple.
At least I think it is important to accurately document this aspect to that in the absence of a native management, integrators are not trapped.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting