I was about to start working on #2235923: Separate "Landing Page" workflow customizations from the content type, which got me thinking about "Landing Pages"...

In my mind, the purpose of "Landing Pages", is to allow users to create a Page Manager page, but without having to actually use the Page Manager (because we want to keep users on the front-end in the IPE and never need to know the Page Manager even exists ;-)).

However, I think it's actually failing in this goal. You still have to visit the Page Manager to:

So, I'm not really sure that the current "Landing Page" as implemented is actually acheiving it's goal of allowing users to create landing pages without having to use the Page Manager.

What if instead, we created a real "Landing Page" content type that didn't have a body, used Panelizer and had a highly customized node edit page to look as simple as the current Landing Page creation form? I think this would solve all the issues I listed above.. What do you think?

TODO

  • Set the new permissions (in defaultconfig) in a hook_update_N() function for sites that update.
  • Let's remove the 'node-edit' id that makes the page styled like the other node edit pages and make it look closer to the existing, simpler "Landing page" add form. Namely, the super small "Permalink" field should be normal sized, because it's more important on landing pages than content pages, and the fields should look less like the header to a form that's got nothing on it.. Here's where the setting is: http://panopoly.mvpcreator.dev/admin/structure/pages/nojs/operation/node...
  • Setup the pathauto settings
  • Finish help text on the node edit page for Landing Pages explaining that it only has the metadata, and you need to go to the View page and use "Customize this page" to change it's content.
  • We need to update existing the Behat tests so they don't break, and to add new tests for new functionality (for example, for pathauto - in the past the path was a required field).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Issue summary: View changes
dsnopek’s picture

Issue summary: View changes
chris_h’s picture

Yes - definitely agree. I've done something similar recently on a client project after hitting issues with discoverability and consistency for editors. It would also solve #2216791 which can only be done with custom code currently.

dsnopek’s picture

Status: Active » Needs review
FileSize
29.68 KB

Here is a patch that implements this. I haven't done a ton of testing on it yet, though.

dsnopek’s picture

Some TODO for my existing patch:

  1. We need to consider pathauto for Landing Pages.. My current patch doesn't mess with it and it uses the same pattern as for Content Pages. Not sure yet if this is OK or needs to be changed.
  2. We should put some sort of help/messaging on the node edit page for Landing Pages explaining that it only has the metadata, and you need to go to the View page and use "Customize this page" to change it's content.
populist’s picture

I think there is value in maintaing the landing pages are page manager pages. While there are a number of things that probably need to be better exposed (editing title, changing menu, deleting), leveraging the existing page manager functionality has a few benefits:

  • Ability to be cleanly exported with features
  • Different functionality than the "Content Page"
  • Does not show up in search
  • Does not show up in content lists
dsnopek’s picture

@populist: Thanks for the feedback! Since you originally implemented the current Landing Pages, it's great to hear your thoughts about their pro's. :-)

To respond to them individually:

  • Ability to be cleanly exported with features

I think anyone who is working with Features, has the skills to use the Page Manager directly. What I usually say when I'm explaining Panopoly to people, is that we try to improve the UX/UI and remove Drupalisms for users and site managers. Unfortunately, site builders will still have to deal with some Drupalisms and complexity.

So, I'm personally fine with saying that you have to use Page Manager if you're going to create a Page for export in Features.

  • Different functionality than the "Content Page"

I think this is satisfied by this patch! There is no body field and so you get a creation form that basically the exact same fields as is on the current "Landing Page" creation form. In the current iteration of this patch, it's still using the node edit styling for Title and Permalink, but we could turn that off and really make it look exactly like the current "Landing page" creation form.

  • Does not show up in search
  • Does not show up in content lists

Hrm. These are very good points that I think we need to consider!

I've actually talked to a number of Panopoly users who wish that landing pages showed up in search! We'll need to make sure that this is configurable for both use-cases.

I don't see any reason why we'd want "Landing pages" to appear in content lists (outside of the admin "Content" page). But since most content lists are Views, we could just make sure to configure our content list views to exclude "Landing pages"!

But I think solutions to both those points could be added to my patch. :-)

dsnopek’s picture

FileSize
16.61 KB
14.1 KB

For reference, here is a screenshot of the "Create Landing Page" form that you get with the current iteration of this patch (it includes the normal node edit styling):

And here is the "Create Landing Page" form for Open Berkeley, which I did a little differently (without the normal node edit styling):

Hopefully, that'll make this discussion a little more concrete. :-)

dsnopek’s picture

Status: Needs review » Needs work

Just a note to myself about a change that needs to be made to this patch: We need to add the new permissions in a hook_update_N() function.

caschbre’s picture

I'm late to this topic but is actually something I've been meaning to bring up. I had a large enterprise project that had to deal with this very scenario / concept even though we weren't using Panopoly.

We ended up with two content types to handle landing pages and content pages. This was mostly driven by the content editor experience but also because landing pages as nodes also gave us additional flexibility. Some landing pages we wanted indexed in our solr instance for example.

We still used page manager, but it was more for the developer if they need to implement something a bit more complex using contexts, etc.

caschbre’s picture

@dsnopek... can you update the issue summary with what still 'needs work' for this patch? I wasn't quite sure what's left to make this work.

dsnopek’s picture

Issue summary: View changes

Sure! I've put a TODO section at the end of the issue summary.

caschbre’s picture

Thanks! I'll see what I can do about some of these.

Change the pathauto settings in some way (still to be decided how -- we could disable pathauto all together for this type to match existing behavior?)

What i've always recommended, and our SEO guys typically recommend, is the pattern would be:
/[node:title]. A user with perms to change the permalink can set it to whatever, but a good default is to just make it inherit the parent page url and add its title.

caschbre’s picture

Assigned: Unassigned » caschbre

I've started work on some of this.

caschbre’s picture

Set the new permissions (in defaultconfig) in a hook_update_N() function for sites that update.

Done

Remove the 'node-edit' id (or is it a class?) that makes the page styled like the other node edit pages and make it look closer to the existing "Landing page" add form.

From the looks of the landing page add/edit screen as is, it looks good. I'm not really sure what we're trying to make it look like.

Change the pathauto settings in some way (still to be decided how -- we could disable pathauto all together for this type to match existing behavior?)

I set the pathauto setting to inherit the parent page url plus the node title. I'd actually recommend making the content page work the same.

Put some sort of help/messaging on the node edit page for Landing Pages explaining that it only has the metadata, and you need to go to the View page and use "Customize this page" to change it's content.

So this is a bit more difficult. We have three options here...

  1. Enable the block/help modules and use the node type submission guidelines. This will probably have the least impact on sites since the help/block modules are pretty common to use. (my preference)
  2. Enable the ctools content pane module so we can create a plain text pane at the top of the landing page node edit panel.
  3. Create a custom widget/pane just to render the static text.

Modify "Content list" widget (and any other default content lists) to exclude Landing Pages

So right now a user has to choose what content type to display in a list. I'm not sure we need to restrict the landing_page from showing up there. that should be the site builder / content editor's choice.

Change search settings so that "Landing pages" are excluded by default (but make it easy to change that in a specific site or child distribution)

Similarly I'm not sure we want to restrict what content type gets displayed in the Solr Search Results View. It should be up to the site to restrict a landing_page from being indexed instead of filtering on display.

caschbre’s picture

FileSize
30.72 KB

This is still a work in-progress but enhances upon the original patch.
* Updates permissions in hook_update_N
* Fixes issue with node/%node/edit panel page condition for node bundle (landing_page) not being set.
* Added pathauto setting to build permalink/path based on parent page url/node-title.

caschbre’s picture

dsnopek’s picture

Matt (@populist) and I discussed this yesterday, and he's approved the approach we're persuing here, that is: replacing Landing Page with a proper content type. So, now it's just a matter of finishing the patch! :-)

caschbre’s picture

The only thing left from what I could tell was the help text which depends on the solution to #2020715: Help Region?. Was there anything else needed in the previous patch?

caschbre’s picture

Status: Needs work » Needs review
FileSize
31.46 KB

Attached is an updated patch that should create the landing page content type, along with help text, etc. It's not dependent on #2020715: Help Region? however the content type guidelines (help text) won't appear unless that patch is applied (or block module manually enabled and help block added to a region).

caschbre’s picture

FileSize
33.11 KB

Missed adding in pathauto settings. Here's and update.

aubjr_drupal’s picture

Is this going to make it into Panopoly 1.12?

dsnopek’s picture

I'm not sure about 1.12, but it will be finished and merged into Panopoly relatively soon! I'd say if not 1.12, then 1.13.

caschbre’s picture

@aubjr_drupal... we could use help testing this patch!

mglaman’s picture

Status: Needs review » Needs work

Had this happen on running updates, permission issue it looks to be.

Matts-iMac:panopoly_pages mglaman$ drush @drupal.panopoly updb -y
 Panopoly_pages  7101  Apply new node landing page permissions to panopoly 
                       roles.
Do you wish to run all pending updates? (y/n): y
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module'    [error]
cannot be null
Performed update: panopoly_pages_update_7101                                [ok]
'all' cache was cleared.                                               [success]
Finished performing updates.                                                [ok]

I had this happen before, it's because Features isn't rebuilt in time for the custom node content type to exist.

Example code

  // Rebuild the feature to ensure our node type exists, other wise an integrity
  // constraint is thrown (because Features hasn't built our node type!)

  // Rebuild the features static caches.
  features_include(TRUE);

  // Revert our FPPS
  $items['panopoly_pages'] = array('node_info');
  features_revert($items);

Updated patch incoming.

mglaman’s picture

Status: Needs work » Needs review
FileSize
761 bytes
33.44 KB

Here's updated patch to fix update and permissions. Not sure if it was just me, but panopoly_pages:variables was "Needs Review" and didn't revert automatically for Panelizer config.

dsnopek’s picture

Support issue which demonstrates why this issue is important: #2353893: Where are the Landing page list and options?

cboyden’s picture

Is it possible, or advisable, to include a way to convert existing (page manager) landing pages to nodes?

dsnopek’s picture

@cboyden: It might be possible, however, myself and @populist agreed that it isn't necessary to provide a conversion. Users who have existing page manager pages can continue to administer them the way they always have, before the switch to implementing "Landing pages" as nodes.

boinkster’s picture

I really like the idea of switching to nodes but would like to commit the resulting page overrides to features on a single node basis. Would there be a way to manage nodes in the same way as panel pages? I did a quick glance at node export but it looks like it's use case is for all nodes in a content type.

mglaman’s picture

boinkster,

The latest dev of UUID Features supports exporting individual node Panelizer overrides + UUID Nodes. Haven't tested, but should work.

caschbre’s picture

Assigned: caschbre » Unassigned
Status: Needs review » Needs work

Looks like one of the last few releases broke this patch. If I get a chance I'll re-roll it but if someone else picks this up sooner, all the better.

caschbre’s picture

Status: Needs work » Needs review
FileSize
33.44 KB

Attached is a re-roll of #26 against the latest dev.

adamsro’s picture

Would it possibly be a good idea to have an option to hide the node title of a landing page on the node edit screen (as opposed going to panelizer full-page-override content settings)? I typically want to do something more custom for a landing pages header section.

dsnopek’s picture

Title: Should "Landing Page" become a node + Panelizer (rather than a Page Manager page)? » Make "Landing Page" into node + Panelizer (rather than a Page Manager page)?
Category: Task » Feature request
Issue summary: View changes
Status: Needs review » Needs work
Related issues: +#2431009: Make it easy to exclude content types from the "Content list" widget, +#2431011: Make it easy to exclude content types from search results WITHOUT overriding the Feature

Alright! I tested out the latest patch, and updated the TODO in the issue summary with the things that are still unfinished. I think we're super close! Thanks for all your work on this, @caschbre. :-)

Specifically, here the things I think we still need to do to get this committed:

  • Let's remove the 'node-edit' id that makes the page styled like the other node edit pages and make it look closer to the existing, simpler "Landing page" add form. Namely, the super small "Permalink" field should be normal sized, because it's more important on landing pages than content pages, and the fields should look less like the header to a form that's got nothing on it. :-) Here's where the setting is: /admin/structure/pages/nojs/operation/node_edit/handlers/node_edit_panel_context_landing_page/layout
  • The new pathauto variable for panopoly_landing_page needs to be set in hook_update_N(), otherwise it won't get set for existing sites. This is because it's in defaultconfig which is only processed on module enable.
  • Let's not configure pathauto settings for panopoly_page in this issue. In short, I'll just say that I don't want the automatic alias for panopoly_pages to appear at the top-level by default, whereas that's what I do want to happen with panopoly_landing_pages (so that's fine). But let's have that discussion on another issue and just remove the those settings from this patch.
  • The help text looks great! But it's a little confusing when you're first creating node, because you can't view the page yet, it doesn't exist. Here's what it looks like in the patch:

    A Landing Page contains only metadata (e.g. title, path, menu option, etc.) by default. To add content to a landing page, first view the page and then click the "Customize this page" button.

    Maybe something like this would make sense in both contexts (new and existing):

    Here you can set the Landing Page's metadata, for example the title, path and menu options. To add content to the page, first save this form and then click the "Customize this page" button.

  • We need to update existing the Behat tests so they don't break, and to add new tests for new functionality (for example, for pathauto - in the past the path was a required field).

I've backed down on the points about restricting what's displayed in a "Content list" and in the search results for now. I do think this is something we'll likely have to address in the future, though.

Usually you don't want landing pages to appear in content listings or search results, because they are things like the home page, the "Contact us" page, a special deal page for Google Adwords, etc.

Currently, you might use a "Content list" widget to display recently posted content (by not putting ANY restrictions on content type - it's a single select box), but after this patch is committed, your new landing pages will start to appear there as well, which could be undesirable. Here's a follow-up issue: #2431009: Make it easy to exclude content types from the "Content list" widget

The same goes for search results - showing the homepage could be confusing (because it contains a "teaser" of the content you actually want to see) and usually pointless since users have no trouble finding the homepage (whereas search is there to help users find a peice of content they're having trouble finding). This is, of course, changable in search_api, but we should provide a way to change it without causing the Feature to become overridden. Here's a follow-up issue: #2431011: Make it easy to exclude content types from search results WITHOUT overriding the Feature

Anyway, that covers my review of the existing patch and everything required to get this committed. However, I also think that @adamsro's idea would be super cool:

Would it possibly be a good idea to have an option to hide the node title of a landing page on the node edit screen (as opposed going to panelizer full-page-override content settings)? I typically want to do something more custom for a landing pages header section.

I think it'd be great to have checkbox or magic string (like "") that would update the Panelizer configuration for the current node and hide the page title.

Another cool feature would be "Make site homepage" checkbox, so users don't have to make the landing page and then navigate to the "Site information" form to make it the front page.

But I think those are "nice to have" features because it's something the current Landing Page functionality doesn't have, so it's not a regression. We can make a Feature request for it later if we don't handle it in this issue.

Anyway, to summarize: we're super close! Let's get this finished up and committed! :-)

caschbre’s picture

Status: Needs work » Needs review
FileSize
33.15 KB
1.17 KB

Here's an updated pages patch and test patch.

  • Removed node-edit.
  • Removed content page pathauto pattern.
  • Added update hook to set landing page pathauto pattern.
  • Updated help text.
  • Updated existing landing page behat test to use the new landing page node.
dsnopek’s picture

Awesome, thanks! I haven't had a chance to do any manual review, but I sent the patches to Travis-CI for automated testing:

https://travis-ci.org/panopoly/panopoly/builds/53098488

dsnopek’s picture

Issue tags: +sprint
dsnopek’s picture

The last test run failed because of #2447475: YouTube test fails on Chrome 41. But everything else otherwise passed!

Running through the tests again just in case:

https://travis-ci.org/panopoly/panopoly/builds/53462386

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

Tested, all works well. This is a huge feature that makes landing pages a lot simpler.

+++ b/panopoly_pages.install
@@ -0,0 +1,55 @@
+  // Revert our FPPS

:) Copy paste fail on my part from earlier. Might want to change before commit

dsnopek’s picture

Issue summary: View changes
FileSize
33.03 KB
2.97 KB

Thanks, @caschbre! All of the remaining TODO is addressed!

I made a couple minor changes to the help text, changed the renderer for the Landing Page edit variant to "standard", and cleaned up the .install file a little bit. A new patch (with an interdiff) is attached.

I'm going to run this through Travis-CI one more time (with the upgrade tests) and if it passes I think this is ready to commit!

EDIT: Here's the Travis-CI build: https://travis-ci.org/panopoly/panopoly/builds/53654324

  • dsnopek committed 8807877 on 7.x-1.x
    Update Panopoly Pages and Test for Issue #2293947 by caschbre, dsnopek,...
dsnopek’s picture

Title: Make "Landing Page" into node + Panelizer (rather than a Page Manager page)? » Make "Landing Page" into node + Panelizer (rather than a Page Manager page)
Status: Reviewed & tested by the community » Fixed

Tested passed! Committed, finally! Huzzah! :-)

Thanks to @caschbre and @mglaman, for continuing to push this forward!

Status: Fixed » Closed (fixed)

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

dsnopek’s picture

In case anyone else find this useful, I recently made a function for a client project to convert from Page Manager pages to Landing Page nodes:

https://gist.github.com/dsnopek/20dd0fec4fbc4a4e6ca8

It doesn't work in all cases - there's lots of Page Manager features that won't work on Landing Page nodes, so it just has to skip them.

If you do give it a try, try it on a testing site (with your production data) before trying it on production AND MAKE BACKUPS!

I make no guarantees that the above code will work in all cases or won't accidentally delete something that it shouldn't.