See meta-issue: #2511554: [meta] Move some parts of Page Manager into CTools

Layout plugin provides an example DisplayVariant called BlockPageLayoutVariant for use with Page Manager in the example 'block_page_layout' module.

While this module isn't really intended for production (you should use Panels instead!) we'll need to update it once BlockDisplayVariant moves from Page Manager to CTools per:

#2511566: Add an abstract version of Drupal\page_manager\Plugin\DisplayVariant\BlockDisplayVariant from Page Manager

CommentFileSizeAuthor
#7 block-page-layout.patch1.05 KBbenjy
#3 2511588-3.patch1.01 KBbenjy

Comments

dsnopek’s picture

dsnopek’s picture

Issue summary: View changes
benjy’s picture

Status: Postponed » Needs review
StatusFileSize
new1.01 KB

This is now unblocked.

Anonymous’s picture

RC1 is out, can someone commit this to repo?

Also the build method should look like this(or at least this one is working for me at this time):

/**
   * {@inheritdoc}
   */
  public function build() {
    $layout = $this->getLayout();
    $regions = $layout->getRegionDefinitions();
    return $layout->build($regions);
  }
benjy’s picture

I'm not sure the patch is ready to be committed, when i tested it the other day there was still much of what we needed in page manager and not ctools I think.

dsnopek’s picture

Yeah, I don't think this patch will work. The shape of the CTools class is different than what I was expecting when I made this issue. I think for now it'd be best to still depend on page_manager and use the PageBlockDisplayVariant class as parent.

benjy’s picture

StatusFileSize
new1.05 KB

Can we commit an update to use PageBlockDisplayVariant then? Here's the exact patch we're using in aGov right now and it's working.

dsnopek’s picture

Status: Needs review » Postponed

Alright, I've made a commit which switches to the new page_manager class per #6:

http://cgit.drupalcode.org/layout_plugin/commit/?id=ecea017eaf546e942ef6...

I'm not entirely sure if this issue is still something we should do. On the one hand, the block_page_layout module is just an example, so it doesn't really matter what it's dependencies are. That said, it would be better if it depended on ctools rather than page_manager, but we'd probably need some changes to CTools in order for that to happen.

So, marking as Postponed for now while the code in CTools settles. After the BADCamp sprint, we should have a much better idea of how it's going to look!

EDIT: Oops! Cross-post with #7 - sorry, I didn't see your patch before making my commit.

benjy’s picture

block_page_layout module is just an example

ooo, that's news to me, is it documented somewhere? We actually used this to build out a block page. Can we rename it to have a _example suffix if it's not meant to be used?

dsnopek’s picture

The module's package is "Examples", but I suppose that's not really much of documentation. :-)

I mean, you can use it! But when Panels is in better shape, that would be the module to use instead. Also, the goal is to get layout_plugin merged into core in 8.1.x, and that won't include the examples modules. The idea is that layout_plugin will just be another plugin manager included in core, not even having a module of it's own (ideally -- we'll see what the core maintainers think of that when we get to that point).

benjy’s picture

Yes we're definitely going to move to Panels when it's ready :)

swentel’s picture

I think we should just remove this also from the layout_plugin repository, it confuses me all the time as well. And maybe mark layout_plugin_example as hidden ?

dsnopek’s picture

Yeah, now that Panels is -beta in Drupal 8, I could see an argument for just removing block_page_layout. It would be good to have an example of how to make a module that renders stuff with layout_plugin, though. Ideas for an alternative example module welcome! Marking layout_plugin_example as hidden probably does make sense too.

Can you make a new issue for removing/hiding the example modules?

swentel’s picture

dsnopek’s picture

Thanks!

dsnopek’s picture

Project: Layout Plugin (obsolete, use core's Layout Discovery) » Block Page (with Layout plugin)

Move to new project