• 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




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How To: Auto-fill News URL field
PostPosted: Mon Apr 06, 2020 8:43 am 
Offline
Forum Members
Forum Members

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 24
Location: Shropshire, UK
I have written an article on how to auto-fill the News URL field from the News title at the click of a button. The button functionality includes replacing spaces with hyphens, setting to lower case etc. This removes the need for re-typing into the URL field.

For example, the News title "How to auto-fill News item URL field" becomes "how-to-auto-fill-news-item-url-field" which is stored in the News URL field.

The article is part of the collection of CMSMS articles that I am writing for my website.

https://ccbswebservices.co.uk/cms-made-simple/how-to-auto-fill-news-item-url-field

I welcome your feedback.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How To: Auto-fill News URL field
PostPosted: Mon Apr 06, 2020 5:07 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 93
Location: Norfolk, UK
Hi Christine, I haven't tried your method but this looks to be a worthwhile thing to do, and the article seems to explain the process clearly.

FWIW my own pretty URLs don't have the "/d,news-detail" bit at the end. I can live with the numbers in the middle.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How To: Auto-fill News URL field
PostPosted: Tue Apr 07, 2020 8:56 am 
Offline
Forum Members
Forum Members

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 24
Location: Shropshire, UK
Charles Butcher \Charles Butcher:
Hi Christine, I haven't tried your method but this looks to be a worthwhile thing to do, and the article seems to explain the process clearly.

FWIW my own pretty URLs don't have the "/d,news-detail" bit at the end. I can live with the numbers in the middle.


Hiya Charles. Thanks for taking a look and for your comment.

I took a look at a news item on your site stanhoe.org and see that its url does not include that "/d,news-detail" bit at the end. I am wondering how you have done that and what I have missed in my own set-up.

I will have to investigate further as I don't like unknowns : O )


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How To: Auto-fill News URL field
PostPosted: Tue Apr 07, 2020 9:26 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 93
Location: Norfolk, UK
Honestly I've no idea why it's like that. The site has been going for ten years and has changed hosting company twice in that time. I set up pretty URLs right at the start and it's always worked well.

With mod_rewrite:

\$1:
<ifModule rewrite_module>
   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.+)$ /index.php?page=$1 [QSA, L]
</ifModule>


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How To: Auto-fill News URL field
PostPosted: Tue Apr 07, 2020 12:47 pm 
Offline
Forum Members
Forum Members

Joined: Sat Aug 04, 2018 4:20 pm
Posts: 24
Location: Shropshire, UK
Hi Charles.

I found out why I was getting d,news-detail added to my News url.

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

This was my News tag:

{News summarytemplate="news-summary-main" detailtemplate="news-detail" category="web design" pagelimit="2"}

which, although I had set a default in Design Manager, this tag outputs d,news-detail at end of URL.

So, changing it to this:

{News category="web design" pagelimit="2"}

drops this from the News url.

Mystery solved!

And thank you for pointing out your site's situation which forced me to take another look at mine : o )


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: How To: Auto-fill News URL field
PostPosted: Tue Apr 07, 2020 3:21 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 93
Location: Norfolk, UK
Glad to be of help! Never did I think that an experienced CMSMS user could learn from me.

Your approach still has value for producing absolutely clean URLs. That would be good for blogging, I should think.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

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