OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Layout templates mess up pages using them when published #6167

Open joshberry opened 8 years ago

joshberry commented 8 years ago

When a layout template is used as the base layout for pages, re-publishing the layout template causes the pages using it to have their content moved into different zones than they were originally placed in.

Steps to repro:

  1. Create a new layout template.
  2. Create a new page that uses the layout template and place content inside the zones defined in the layout.
  3. Go back to the layout (you'll need to make the Layout content type listable as another bug currently prevents them from being displayed on the admin page) and re-publish the layout template.
  4. Go back to the page that uses the layout template. You'll see that the content you placed on the page originally is now arranged differently.

IMO, this is a serious issue as layout templates are not really of much use as long as this bug is in place. If you were to use them now, every time you go to update a layout template, you'd need to go back and redo every page that used it - which kind of defeats the purpose of layout templates in the first place.

sfmskywalker commented 8 years ago

Yeah that renders the feature pretty much useless.

remesq commented 8 years ago

I was just coming here to post about this issue. All I did was add a CSS class to one of my rows, published the Layout, and it blew up about 30 pages I had using the Layout template. I had to manually open up the HTML elements I had in each page, copy the source code, place a new HTML element in the zone I wanted it, rinse, repeat for all 30 pages (and the 4-5 different zones I had).

I.e., cut/paste won't work since the Grid>Row>Column is in the Layout template itself. Also, trying to drag/drop the HTML element into the corrected zone won't work either (it just moves up and down, like it can only be drag/dropped within the "zone" it's in.

I will note that I simply cloned my first page using the layout and then changed the markup for each individual page originally. So I don't know if that is part of the problem.

Back in May 2015, I posted this Issue, which is similar.

EDIT: I just changed another Layout template I had, and the one page I had using it did not get affected. The reason, it seems, is that the Row>Column I deleted and moved in the Layout template did not have any associated content in the page (i.e., the "zone" was empty in the page).

In my other Layout template, the pages had content in the "zones".

Hope this helps.