Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Forcing the Article ID in the URL-only title field
uli wrote:
springworks coded:
<snip>
['Section']=="<selected_section>"</snip>(from the public function update block, one post above)
I’m trying to understand this for potential future alterations. What condition on the Write panel does this describe, or, the other way around: When is this condition not met?
Sorry, I should have made this a bit clearer!
<selected_section> is replaced with the section name where you want to customise the URL title. As I’ve only used this on one site, I hard-coded the section name in there. When new articles are created in that section, the URL title is created from a concatenation of the contents of custom field 4 and the article title.
Obviously to make this more useful, it would be good to have some way of choosing how the custom URL was created (i.e. what elements were used to make it) and what sections it was active in. (If I ever get around to doing that, it would be a handy plug-in to release, but until then, at least people can cut and paste my code and tweak it themselves!)
Hope that helps!
Offline
#17 2013-02-07 19:41:15
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,319
Re: Forcing the Article ID in the URL-only title field
Thanks, springworks. I guessed it had to be a placeholder but then I don’t know PHP syntax overly well.
springworks wrote:
Sorry, I should have made this a bit clearer!
Noone can figure a dodo like me would try to “read” that code without a coding background. But with a backup copy of everything at hand I outgrow myself ;)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline