Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-11 01:00:27

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

How to get a trailing slash in URI's?

I am attempting to get my site URI’s as such: example.com/section/article/ but am having a bit of trouble finding out how to get the trailing slash.

I understand it can be done with .htaccess, which I’ve done (and it’s redirecting beautifully), but I don’t know how to get Textpattern to write the canonical URI’s this way?


\\//_ Live long and prosper.

Offline

#2 2009-12-11 01:46:38

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How to get a trailing slash in URI's?

Remember that articles are not directories. Anyways:

<txp:permlink />/

Just add appending slash.

Last edited by Gocom (2009-12-11 01:48:05)

Offline

#3 2009-12-11 03:32:44

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

Re: How to get a trailing slash in URI's?

Thank you, Gocom. I’ve been told such (articles are not directories), but I’m trying to maintain a link syntax from a former CMS.


\\//_ Live long and prosper.

Offline

#4 2009-12-11 03:38:05

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

Re: How to get a trailing slash in URI's?

Gocom wrote:

Remember that articles are not directories. Anyways:
bc. <txp:permlink />/
Just add appending slash.

I may not have understood correctly. I do this?

<txp:permlink>/<txp:title /></txp:permlink>

That outputs the same link, with the title having a slash in front of it.

/Example

\\//_ Live long and prosper.

Offline

#5 2009-12-11 04:19:43

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: How to get a trailing slash in URI's?

But I think something like would work (not tested)

<a href="<txp:permlink />/"><txp:title /></a>

Offline

#6 2009-12-11 04:30:58

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How to get a trailing slash in URI's?

jonlandrum wrote:

I may not have understood correctly. I do this?

<txp:permlink /> is both, a single tag and a container. When used as a single tag, it outputs just the URL.

Offline

#7 2009-12-12 02:08:07

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

Re: How to get a trailing slash in URI's?

Gocom wrote:

<txp:permlink /> is both, a single tag and a container. When used as a single tag, it outputs just the URL.

Oh, I didn’t know that.

tye wrote:

But I think something like would work (not tested)
<a href=”<txp:permlink />/”><txp:title /></a>

I’ll go test that right away. Thanks tye, and thanks again Gocom.

Last edited by jonlandrum (2009-12-12 02:08:28)


\\//_ Live long and prosper.

Offline

#8 2009-12-12 04:30:13

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

Re: How to get a trailing slash in URI's?

Works exactly as advertised, thank you both once again.


\\//_ Live long and prosper.

Offline

#9 2009-12-16 15:29:15

jonlandrum
Member
From: Shi'Kahr
Registered: 2009-11-26
Posts: 35
Website

Re: How to get a trailing slash in URI's?

Found a better solution (doesn’t require changing tags for every form, and works with plugin-generated content such as site maps): gbp_permanent_links


\\//_ Live long and prosper.

Offline

Board footer

Powered by FluxBB