Hi,

So, along the same lines as #2485051: Save as @bundle_name default IPE button text should use panel title when choice is enabled, I feel it would be an improvement if the Revert to default button reverted to the previously chosen Panelizer default rather than the bundle default (on bundles that have panel choice enabled, of course). So for example, let's say:

  • I have a panelized node type (let's call it "Landing Page") with panel choice enabled, and multiple panelizers configured for it. (let's call them "Default", "Homepage", and "Article" -- and in this case "Default" is configured in panelizer to be the bundle type default).
  • On a particular node, I have chosen "Homepage" as the panelizer default on the Node form.
  • Then, I "Customize" the node in the IPE and save as Custom.
  • Sometime later I go to revert the node in the IPE.

Okay, at this point the button reads "Revert to Landing Page Default", and when you click it, the node gets reverted to the bundle type default panelizer which is "Default".

What I am suggesting is that we save which default was chosen before it was customized and when you go to revert, the button would say "Revert to Homepage Default". And when clicked, the node would be reverted to the "Homepage" panelizer instead of "Default".

Attached patch is a first attempt at this. I'm using the $panelizer->extra storage right now to keep track of which panelizer_default was chosen before the customization... but we could also add a column to the panelizer_entity table. I wasn't sure if that was too heavy handed though.

Thanks for your time and consideration!
drclaw

Comments

drclaw’s picture

Status: Active » Needs review
StatusFileSize
new4.41 KB

Updated patch newest dev + fix for overwriting the saved default after saving the panelizer a second time.

drclaw’s picture

StatusFileSize
new4.61 KB
new564 bytes

Aaaaand, here's another patch that adds a entity_save for good measure (to invalidate entity or page caches, for example).