Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-09-07 14:10:56

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

Recommended plugin for example.com/sometext/section-name/article-name

Hi.
I’d like to be able to have an additional bit of text inserted into the URL before the section name, like this:

http://example.com/sometext/section-name/article-name

Is there a plugin considered the go-to for this kind of thing? I will admit to not being too adventurous with plugins and more keen on what core can do, but I’m changing my tack for a new project and would appreciate any pointers.

Thank you in advance.

Offline

#2 2012-09-07 15:50:41

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: Recommended plugin for example.com/sometext/section-name/article-name

If you need to do it for all links, this could work, though I have not tested it.

Offline

#3 2012-09-07 15:53:16

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

Re: Recommended plugin for example.com/sometext/section-name/article-name

Thank you, etc – I’ll take a look.

Offline

#4 2012-09-07 16:30:40

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: Recommended plugin for example.com/sometext/section-name/article-name

Otherwise, for selective replacements (say, in some article form) you can replace <txp:permlink><txp:title /></txp:permlink> by a quick-n-dirty

<txp:variable name="site_url" value='<txp:site_url />' />

<txp:etc_query
  data='<txp:permlink><txp:title /></txp:permlink>'
  replace="a/@href={$str_replace({?site_url}|{?site_url}blah/|{?})}"
/>

Last edited by etc (2012-09-07 16:40:30)

Offline

#5 2012-09-07 16:33:45

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

Re: Recommended plugin for example.com/sometext/section-name/article-name

Huh. I never thought of that – great idea. Thanks again, etc!

Offline

Board footer

Powered by FluxBB