Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-12-14 16:35:44

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

How to change article's URL slug each time new title is saved?

If an article is set to Live, the URL it can be accessed is somehow locked so it doesn’t change if the article gets a new title. I’d like to override this. Could it be done easily? :-)

Offline

#2 2015-12-14 16:52:24

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: How to change article's URL slug each time new title is saved?

You could empty the URL field with JS. Then the field entry is created anew on saving.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2015-12-14 17:07:23

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

Re: How to change article's URL slug each time new title is saved?

Oh yes, it’s simple as that. Thanks. :-)

Offline

#4 2015-12-15 06:24:19

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

Re: How to change article's URL slug each time new title is saved?


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#5 2015-12-15 10:14:45

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: How to change article's URL slug each time new title is saved?

kuopassa wrote #297089:

If an article is set to Live, the URL it can be accessed is somehow locked so it doesn’t change if the article gets a new title. I’d like to override this. Could it be done easily? :-)

there was once this plugin: wdm_update_url
I tried to recompile it:

# wdm_update_url v0.1
# Update the URL-only title when editing articles
# William Meleyal
# http://www.graphics-plus.co.uk/

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

YTo5OntzOjc6InZlcnNpb24iO3M6MzoiMC4xIjtzOjY6ImF1dGhvciI7czoxNToiV2lsbGlh
bSBNZWxleWFsIjtzOjEwOiJhdXRob3JfdXJpIjtzOjMxOiJodHRwOi8v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t9

Last edited by whocarez (2015-12-15 10:18:57)

Offline

#6 2015-12-15 11:21:04

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 228
Website

Re: How to change article's URL slug each time new title is saved?

Thanks, whocarez! It’s basically identical solution that I made yesterday. Problem solved. :-)

Offline

Board footer

Powered by FluxBB