News module links to detail pages - revisited

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
cjcollen
Forum Members
Forum Members
Posts: 36
Joined: Sat Aug 04, 2018 4:20 pm
Location: Shropshire, UK

News module links to detail pages - revisited

Post by cjcollen »

Hi. Bailiwick posted about a problem with the URL of a News detail item having "/d,news-detail" at the end of the URL.

Here is link to that post made on 27 Sep 2019:
viewtopic.php?f=8&t=81636&p=344063&hili ... rl#p344063

The post is over 6 months and so no further comment can be made, hence this new post from me as I too am having this problem.

My CMSMS version is 2.2.13.

I added a brand new News item (not imported from an old version) and viewed the post with different settings in config and the News settings.
Here are my test outputs which I carried on my local wampserver:
Test 1:
config / url_rewriting is not set
News settings: no default page set for detail view
Resultant url:
localhost/blah-blah/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=27&cntnt01detailtemplate=news-detail&cntnt01returnid=34

Test 2:
config / url_rewriting is set to mod_rewrite
News settings: no default page set for detail view
Resultant url:
localhost/blah-blah/news/27/34/This-is-a-new-article/d,news-detail

Now the d,news-detail bit appears at end of this url.

Test3:
config / url_rewriting is set to mod_rewrite
News settings: defailt page is set for detail view
Resultant url:
localhost/blah-blah/news/27/117/This-is-a-new-article/d,news-detail

The d,news-detail is still present.

The only way I can get rid of this is to set the News item with an explicit value in its URL (slug) field.

Does anyone know why this extra bit is put out?
cjcollen
Forum Members
Forum Members
Posts: 36
Joined: Sat Aug 04, 2018 4:20 pm
Location: Shropshire, UK

Re: News module links to detail pages - revisited

Post by cjcollen »

I have found the answer to my own question!

In Design Manager, if you have set a default template for the News detail, then you don't need to include the detail template parameter in the News tag.

I was including the detail template parameter, even though I had set the default and this is why the d,news-detail bit was appearing in my News url.

So this is what my News tag was:
{News summarytemplate="news-summary-main" detailtemplate="news-detail" category="web design" pagelimit="2"}

So I removed template parameters to give this tag:
{News category="web design" pagelimit="2"}

And the resultant URL is:
localhost/blah-blah/news/27/117/This-is-a-new-article

Phew - mystery solved
Locked

Return to “CMSMS Core”