Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
dem_clone: Duplicating articles with a reference to their origin
Without the adi_menu plugin installed
It does just that. When cloning, it stores the ID of the original article in the custom-field of your choice (default custom-1) of the new article.
With adi_menu installed
it is a little helper plugin for a mulit-language setup (see how it should be set up here)
The plugin copies an article with a reference to the original article.
A chosen custom-field is used to hold the ID of the original article. Which should be in your default language.
The relation between articles in their different languages can then be detected through this custom-field.
Furthermore it puts the newly cloned article straight in its correct section.
It also marks articles red that are in a non-default language section and hides all non-default sections in the sections dropdown (toggleable).
Download dem_clone v0.2
Hopefully I´ll find the time to make dem_clone grow and make it work in a more stand-alone and universal way to help with multi-lingual setups.
Any suggestions on how to improve it are welcome.
Last edited by demoncleaner (2021-05-12 10:48:06)
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
Thank you.
It seems interesting and useful. I’ll make a test.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
demoncleaner wrote #330080:
[…] it stores the ID of the original article in custom-1 of the new article.
Is that hard coded to the custom-1 field ? On one project where this might be useful, I already have a number of custom fields defined so, this might make a mess… Custom-9 is still available though :)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
Yes thats hardcoded.
For a quick solution you could just change “custom-1” 2 times in the code to “custom-9” and it should work fine.
I think in the next version the plugin will have some preferences where you could choose the custom_field you want to apply this to.
I also planned already to have another field in preferences where you would define your default language. Which will also help in various ways. Only from curiosity: Are you using it in a multi-language context or for something else?
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
I updated the plugin in my first post. It has preferences now where you can define the custom-field of your choice.
If nothing is chosen it will have take custom-field 1.
Last edited by demoncleaner (2021-05-12 10:49:49)
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
demoncleaner wrote #330115:
I updated the plugin in my first post. It has preferences now where you can define the custom-field of your choice.
If nothing is chosen it will have take custom-field 1.
Perfect!
Unfortunately, the link provided above returns a 404
error page…
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: dem_clone: Duplicating articles with a reference to their origin
Sorry. It is fixed.
Offline