I am in the habit of cloning  pages to speed up the entry of new pages. I do this because the format of my writing follows a set pattern as the site in question is designed to be a reference site for others. However if I clone an existing page, e.g. one created prior to my changing the layout for new pages,  the cloning process copies the "old" layout and associates the new page with the old layout - e.g. "Layout (Nodes with Images)" is copied but all my new content uses "Layout (Pages with Paragraphs)".

I'd like to use the new layout with the cloned content but I cannot work out how to do this... Any suggestions?

Most helpful answers

Yes, I'm still somewhat confused about your setup and what you are after, I admit. 

If all content of a certain type is showing up on the wrong layout, you may just need to adjust the visibility conditions and/or the order of your layouts to make sure the right layout is selected.

If you need to clone certain content from one type to another to make sure the right layout is selected (and you don't want to lose data on fields from the initial content type), you may need to add those same fields to the second content type so that the field data has somewhere to go when you convert.

It's a little bit difficult to grasp what you're working with and what you are intending to do, so take my suggestions with a grain of salt.

Comments

@ian

You might need to provide a few more details. I'm not quite clear about what your proposed workflow is and how it's working. 

How are you cloning "nodes"?

How did you associate "new" nodes with a "new" layout?

Usually, nodes are associated with a layout through visibility rules on the layout. You can assign a specific content type to use a specific layout. You can assign a specific node to a specific layout?

I'm not sure how you would get new "article" nodes to use a different layout than old "article" nodes. 

If you create a NEW node without cloning it, does it use the correct layout?

Are you new and old nodes all using the same content type?

Given my understanding of Backdrop, even after 2 years of using it, must be considered "basic" and that I still struggle to use the "proper" terminology I will try to explain (I'm coming up for 72 and don't have a coding background and I'm self-taught in typo3, drupal, and Backdrop)

I clone nodes using Node Clone Module - I used a similar module on Drupal 7 (D7) and have been cloning nodes for several years now to speed up the process of creating new content so it is second nature.

My site is a reference type of site so much of the content follows a set design — first is a small gallery of images, then a paragraph that identifies the topic item. What follows is a series of paragraphs that describes the topic item (front, back, top, bottom) and finally a paragraph giving a date or date range and the reference number allocated. So you can see how cloning helps cut down the work as I often only have to change key words in several paragraphs.

I have the following layouts in Backdrop: 

  • Home Page using Simmons Full template - no conditions set,
  • Nodes with Videos using Boxton template with condition "Content Type is Video Page",
  • Stories using Moscone Flipped  with condition "Content Type is Story",
  • Nodes with Images using Boxton template with condition "Content type is one of: Content: Page, Page, Test Node, Top Page, Video Page",
  • Pages with Paragraphs using Moscone Flipped with condition "Content type is one of: Content: Page, Top Page",
  • Collection List using Moscone Flipped with condition "Content ID is: 1533"
  • Special Pages using Special template (custom) with condition "Current path is one of: "SpecialSaloon , Special_Issues"

 If I create, from scratch, new content I can assign it a content type "Content: Page" which I now use as the default content type. But I can just as easily assign it to Video Page, Page, or Story depending on what its end purpose is. However for legacy reasons some content is still deemed to be Pages or Stories as these were the common content types I used in D7 which was ported over to Backdrop CMS for me by an "expert" (and he was... the job was much bigger than either of us had imagined!) - so this means not all content uses the same content type. "New" nodes are of the new content type "Content: Page", old nodes are of any other content type depending on their content type on D7. Therefore if I clone an "old" node I get the "old" content type (Page) and associated layout "Nodes with Images". What I really want to do is use the layout "Pages with Paragraphs" after cloning the content - I suppose I could add content type "Page" to Pages with Paragraphs layout but I'm not sure how that would affect existing content of type Page or cloned content of type Page. 

Does this clear things up? or does it make thing more muddy? :D

However for legacy reasons some content is still deemed to be Pages or Stories as these were the common content types I used in D7 which was ported over to Backdrop CMS for me by an "expert" (and he was... the job was much bigger than either of us had imagined!) - so this means not all content uses the same content type.

It sounds like the layout system is working correctly but you have legacy content types that are getting cloned. It's one extra step, but perhaps when you are about to clone legacy content you can first double check that it is the correct/current content type -- and if not, use Node Convert to convert that node to the expected type before cloning it? I'm not sure how many legacy items you have, but you should also be able to use Node Convert in a batch to convert many at one time, so this could be a one-time process if you are ready to convert all the legacy types to current types.

Yes I could try checking before actually cloning, but I have over 1400 nodes that are legacy nodes (the site has been running for 14 years).

Re the suggestion of using Node Convert - I've tried this before and didn't follow how it converted type Page to type Content: Page - also I was really hesitant about using it as it was a beta release - I will experiment again with some cloned nodes to see if the results are what I expect and look right.

As the author of Node Clone have you thought about issuing it as an official release?

RE: Beta vs. full

Yes, it's been out long enough and has no issues filed, so it's probably ready for a full release on the next release.

Following up on my use of Node Convert - I discovered quickly that converting some cloned nodes looses all text and images. I've discovered this is due to the different ways the Page and Content: Page fields are set out.

Here is Page:

Page_Screenshot

As you can see there is a Body Group, a Body field, and a Multiple Use Text field [added later to allow for additions to the pages using the Paragraphs module(?)], the an Images Group with Images field.

Here is the Content: Page...

Content Page

As you can see it has no Body Group or Body field. It has a Text Only Group with Multiple Use Text field and a Side Paragraphs Group. Since there is no Body Group or Body field, and Node Convert does not allow me to Append the Body field(?) to anything other than a Body field(?), the conversion looses the content. The same happens to the Image Group and the Image field. I think it might work if Body could be appended to Multiple Use Text.

To further enhance your understanding I will point out that the Text Only -Now with Images Group contains several fields as shown below.

Confused??     :D

Naturally, for proper conversion, the source and destination types must have the same fields, how could it be otherwise. 

Isn't it easier to make the required layout once for all the "legacy" nodes than to convert 1400 nodes? 

Although I still don't fully understand the problem. Sorry if this is off topic.

Yes, agreed, if all 1400 nodes are supposed to be on a different layout then adjusting the layout visibility conditions to match would certainly be easier than converting them to another type.

Yes, I'm still somewhat confused about your setup and what you are after, I admit. 

If all content of a certain type is showing up on the wrong layout, you may just need to adjust the visibility conditions and/or the order of your layouts to make sure the right layout is selected.

If you need to clone certain content from one type to another to make sure the right layout is selected (and you don't want to lose data on fields from the initial content type), you may need to add those same fields to the second content type so that the field data has somewhere to go when you convert.

It's a little bit difficult to grasp what you're working with and what you are intending to do, so take my suggestions with a grain of salt.

I have managed to convert a few nodes and then saved them as Dummy Content. My way forward appears to be to use this dummy content for cloning.

The problem arises from the legacy content (D7 originally) having been based around a template that had a body field whereas the "new" content is based around the use of the Paragraphs module and my new layout has no body field for Node Clone to fill.

I will continue to clone existing content and save as a draft item before attempting to use Node Clone. I think I can make this work enough that I don't have to add a body field to my new template.  :D  Eventually ending up with enough content to allow me to carry on in the manner I have been accustomed to. You probably don't follow what I'm trying to achieve because "my brain don't work like yours" :D

Very thankful for everyone's input - no grains of salt required!

I may not make it due to the time difference - it will be 7am here and while that is not early for most folks it is a tad early for me! :D

I will however do my best to be there....