In order to customize the markup for Panopoly's previews on the "Add content" modal, Radix copies some code from panopoly_magic in includes/panel.inc, namely radix_process_panels_add_content_modal().

Unfortunately, this is broken now that the code in panopoly_magic has changed for the new "Single" preview mode per #2155377: Only show one widget preview at a time when adding content in panels.

We could re-copy the code from panopoly_magic again so that it's compatible, but it would be better to make it possible to customize the markup without having to copy any code! There's a Panopoly issue for that: #2496027: Generate preview markup in a theme function/template

I'd like to use this issue to take advantage of those changes, removed the copied code and customize the preview markup in a way that works with all of Panopoly's preview modes!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Issue summary: View changes
Status: Active » Needs work
FileSize
3.43 KB

Here's the first pass at a patch!

It still needs some styling changes in order to hide/show the inline add buttons and maybe some hover styling like the default panopoly_magic styling. Also, it'd be nice to not have to provide our own radix_panopoly_magic_preview_link() so maybe 'clearfix' should be added to the template in panopoly_magic.

Also, it turns out that less code needs to be removed, so I've updated the issue summary.

lsolesen’s picture

$ git apply radix-panopoly-magic-preview-2502939-1.patch                                                         
radix-panopoly-magic-preview-2502939-1.patch:11: trailing whitespace
.                                                                   
/**                                                                 
warning: 1 line adds whitespace errors. 

It goes from this (with no preview):

To this (where preview works - but layout is messed up):

lsolesen’s picture

If I add the patch from #2496027: Generate preview markup in a theme function/template, The buttons gets nicely aligned again.

dsnopek’s picture

Here's an updated version of this patch for the latest Panopoly patch on #2496027-7: Generate preview markup in a theme function/template. We're able to remove radix_panopoly_magic_preview_link() because the upstream theme function includes "clearfix"!

Keeping at "Needs work" until the Panopoly patch is merged.

dsnopek’s picture

FileSize
3.17 KB

Another updated version of this patch for the latest patches on #2496027-9: Generate preview markup in a theme function/template

dsnopek’s picture

Status: Needs work » Needs review
FileSize
3.1 KB

Here is hopefully my last version of this! I decided to put the classes directly in the template rather than a preprocess function, since the template is easier to understand with those classes there and any customization would likely need to change the template anyway.

I'm going to probably commit the Panopoly issue today, so marking as "Needs review".

  • dsnopek committed 2f9b4a9 on 7.x-3.x
    Issue #2502939 by dsnopek: Incompatible with Panopoly's "Single" preview...
dsnopek’s picture

Status: Needs review » Fixed

Panopoly issue has been fixed: #2496027: Generate preview markup in a theme function/template

So, committing this one as well! :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.