Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-11-01 06:53:19

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

trailing slashes

Hello,

The default seems to be to not have training slashes on article names if the option title is used, whereas the trailing slash does appear after categories and with /articles/. Can I ask is there any relatively painless way to enforce trailing slashes for articles as well, and for the canonicals in the metas? I tried messing with .htaccess but it didn’t make my install too happy :)

Or is it as simple as changing all “<txp:permlink />” to “<txp:permlink />/”?

Thank you

Last edited by ingleslenobel (2014-11-01 06:59:13)

Offline

#2 2014-11-02 09:41:30

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: trailing slashes

Trailing slashes are for directories only. Why would you want them everywhere?

Offline

#3 2014-11-02 10:40:05

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

Re: trailing slashes

It’s for consistency – the rest of the site uses this and I need the trailing slash to be able to automatically call in an image on a script. Would you have any idea what I need to do to achieve this?

Thank you

ruud wrote #285367:

Trailing slashes are for directories only. Why would you want them everywhere?

Offline

#4 2014-11-02 10:57:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: trailing slashes

The permlink trick you suggested above should work. TXP doesn’t mind the extra trailing slash as far as I can tell.

Offline

#5 2014-11-02 11:01:50

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

Re: trailing slashes

Veel bedankt :)

Offline

#6 2014-11-02 11:03:29

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

Re: trailing slashes

Although, yes, that displays the permalink with a trailing slash printed into the head, but any idea how to get textpattern to show and use the trailing slash for its internal links?

Last edited by ingleslenobel (2014-11-02 11:03:44)

Offline

#7 2014-11-02 12:15:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: trailing slashes

Which internal links are you referring to?

Offline

#8 2014-11-02 12:39:57

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

Re: trailing slashes

article list, for example, but I think I’ve solved it by just adding the slash in the form too. Bit of a bodge but works…

Note if you do this remember to do the same for the forward/back buttons too, a breadcrumb if you have one and tweak the php in the rss/atom generators $permlink = $permlink . "/";

Thanks

Last edited by ingleslenobel (2014-11-02 14:26:27)

Offline

#9 2014-11-02 15:33:50

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: trailing slashes

Aside: many browsers are stripping back the address bar so they don’t show the full URL by default; they will with a hover or click in some cases, but bear this in mind. Trust me, I’ve obsessed about URL formats before now, but I’ve moved on. I can absolutely understand why you want to control it, but life is short – don’t spend too long on this.

Offline

#10 2014-11-02 15:35:56

ingleslenobel
Member
Registered: 2014-10-16
Posts: 88

Re: trailing slashes

Yeah agreed – was a 10 minute fix in the end. easy peazy

gaekwad wrote #285380:

Aside: many browsers are stripping back the address bar so they don’t show the full URL by default; they will with a hover or click in some cases, but bear this in mind. Trust me, I’ve obsessed about URL formats before now, but I’ve moved on. I can absolutely understand why you want to control it, but life is short – don’t spend too long on this.

Offline

Board footer

Powered by FluxBB