Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-05-10 08:18:09

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

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

#2 2021-05-12 08:24:14

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

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

#3 2021-05-12 08:49:27

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,189
Website

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

#4 2021-05-12 09:16:21

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

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

#5 2021-05-12 10:43:36

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

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

#6 2021-05-13 05:35:58

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

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

#7 2021-05-13 06:52:19

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

Re: dem_clone: Duplicating articles with a reference to their origin

Sorry. It is fixed.

Offline

Board footer

Powered by FluxBB