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:
- List existing Landing Pages (user's instead expect this to be under Admin -> Content)
- Change a Landing Page's title (yet, this is configurable on creation!)
- Change a Landing Page's menu item (yet, this is configurable on creation!)
- Delete a Landing page: #2289161: Unable to delete a Landing Page without using the Page Manager
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 settingsFinish 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).
Comment | File | Size | Author |
---|---|---|---|
#41 | interdiff.txt | 2.97 KB | dsnopek |
#41 | panopoly_pages-landing_page_node-2293947-41.patch | 33.03 KB | dsnopek |
#36 | panopoly_test-landing_page_node-2293947-36.patch | 1.17 KB | caschbre |
#8 | Selection_121.png | 14.1 KB | dsnopek |
#8 | Selection_130.png | 16.61 KB | dsnopek |
Comments
Comment #1
dsnopekComment #2
dsnopekComment #3
chris_h CreditAttribution: chris_h commentedYes - 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.
Comment #4
dsnopekHere is a patch that implements this. I haven't done a ton of testing on it yet, though.
Comment #5
dsnopekSome TODO for my existing patch:
Comment #6
populist CreditAttribution: populist commentedI 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:
Comment #7
dsnopek@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:
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.
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.
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. :-)
Comment #8
dsnopekFor 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. :-)
Comment #9
dsnopekJust 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.Comment #10
caschbre CreditAttribution: caschbre commentedI'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.
Comment #11
caschbre CreditAttribution: caschbre commented@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.
Comment #12
dsnopekSure! I've put a TODO section at the end of the issue summary.
Comment #13
caschbre CreditAttribution: caschbre commentedThanks! I'll see what I can do about some of these.
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.
Comment #14
caschbre CreditAttribution: caschbre commentedI've started work on some of this.
Comment #15
caschbre CreditAttribution: caschbre commentedDone
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.
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.
So this is a bit more difficult. We have three options here...
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.
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.
Comment #16
caschbre CreditAttribution: caschbre commentedThis 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.
Comment #17
caschbre CreditAttribution: caschbre commentedRelated: #2020715: Help Region?
Comment #18
dsnopekMatt (@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! :-)
Comment #19
caschbre CreditAttribution: caschbre commentedThe 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?
Comment #20
caschbre CreditAttribution: caschbre commentedAttached 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).
Comment #21
caschbre CreditAttribution: caschbre commentedMissed adding in pathauto settings. Here's and update.
Comment #22
aubjr_drupal CreditAttribution: aubjr_drupal commentedIs this going to make it into Panopoly 1.12?
Comment #23
dsnopekI'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.
Comment #24
caschbre CreditAttribution: caschbre commented@aubjr_drupal... we could use help testing this patch!
Comment #25
mglamanHad this happen on running updates, permission issue it looks to be.
I had this happen before, it's because Features isn't rebuilt in time for the custom node content type to exist.
Example code
Updated patch incoming.
Comment #26
mglamanHere'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.
Comment #27
dsnopekSupport issue which demonstrates why this issue is important: #2353893: Where are the Landing page list and options?
Comment #28
cboyden CreditAttribution: cboyden commentedIs it possible, or advisable, to include a way to convert existing (page manager) landing pages to nodes?
Comment #29
dsnopek@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.
Comment #30
boinkster CreditAttribution: boinkster commentedI 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.
Comment #31
mglamanboinkster,
The latest dev of UUID Features supports exporting individual node Panelizer overrides + UUID Nodes. Haven't tested, but should work.
Comment #32
caschbre CreditAttribution: caschbre commentedLooks 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.
Comment #33
caschbre CreditAttribution: caschbre commentedAttached is a re-roll of #26 against the latest dev.
Comment #34
adamsro CreditAttribution: adamsro commentedWould 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.
Comment #35
dsnopekAlright! 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:
/admin/structure/pages/nojs/operation/node_edit/handlers/node_edit_panel_context_landing_page/layout
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.Maybe something like this would make sense in both contexts (new and existing):
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:
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! :-)
Comment #36
caschbre CreditAttribution: caschbre commentedHere's an updated pages patch and test patch.
Comment #37
dsnopekAwesome, 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
Comment #38
dsnopekComment #39
dsnopekThe 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
Comment #40
mglamanTested, all works well. This is a huge feature that makes landing pages a lot simpler.
:) Copy paste fail on my part from earlier. Might want to change before commit
Comment #41
dsnopekThanks, @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
Comment #43
dsnopekTested passed! Committed, finally! Huzzah! :-)
Thanks to @caschbre and @mglaman, for continuing to push this forward!
Comment #45
dsnopekIn 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.