Exposing novice users to the Drupal (7 or 8) block admin interface is problematic yet those users still need to be able to edit block content. This presentation proposes a solution I call "snippets" that allows content editors to edit every little bit of content on their site without them needing access to the block admin interface. It provides a much more intuitive user experience.
4. Quandary: Block Editing by Clients
â Novice clients invariably want to be able to edit EVERYTHING
that looks like content
â And blocks often contain chunks of text or markup that should
be able to be edited by clients
â But exposing clients to the block admin interface âŠ
â is RISKY, as sometimes site layout, styling & design
integrity rely on block position & content (inline classes &
ids etc) not changing
â adds COMPLEXITY to the authoring experience
â increases COSTS of training, support & maintenance
5. Quick demo ...
â Block admin
â Easy to mess up layout & design
â Yet another interface to learn
â Lots of extraneous information
6. What if clients could ...
â edit every little bit of content on their site without
needing access to the block admin interface or
âadminister blocksâ permissions?
â edit everything via the familiar content overview (or
workbench) page & node edit interfaces?
â Bonus extra:
â edit complex multipart page elements on one page?
7. One Solution: âSnippetsâ
Snippets are:
â Small chunks of text or markup
â That can be used within blocks and views
â Initially created by site builders
â But fully editable by novice clients in exactly the same
way as any other content
â Block content can now benefit from node revisions
Some may be using this technique already!
8. Another Solution: Block Access
â Block Access module
â Have not used this extensively myself
â Would suit some use cases
â However âŠ
â Still requires client familiarity with block admin interface
â Doesnât address editing of text within views headers & footers
â âSnippetsâ handle both cases with ease
So letâs get on with it!
9. Snippets: What Youâll Need
â Drupal 7 + Views
â This âproblemâ and proposed solution also apply to Drupal 8 but some of these modules
not yet Drupal 8 ready
â Nodeblock
â Allows setting a content type as a block
â Custom Search (optional)
â Exclude snippet nodes from search. Not generally a good look if they show in search
results! Note: for SEO you should also exclude from sitemaps! (not covered here)
â Exclude Node Title (optional)
â Optionally exclude node titles. Very flexible.
â Simplify (optional)
â Dramatically simplify the content editing experience for clients
10. Snippet: Basic Setup
1. Install required contrib modules
â âNodeblockâ, âExclude Node Titleâ, âSimplifyâ & âCustom Searchâ
2. Create âSnippetâ content type
â Title & Body (with no summary) fields
â Enable Nodeblock âAvailable as blockâ
â Hide extra fields using Simplify
3. Exclude âSnippetâ nodes from search
â âCustom Searchâ > âContent tabâ > âContent exclusionâ
4. Setup âSnippetâ node title exclusion option
â âExclude Node Titleâ config > âSnippetâ = âUser defined nodes âŠâ and check all view modes
5. Create client user, role & permissions
â Create test user âclientâ
â Create âclient authorâ role & assign role to user âclientâ
â Grant permissions for âclient authorâ role:
â âuse contextual linksâ, âaccess content overview pageâ, âview published contentâ, view
own unpublished contentâ, âsnippet: edit own contentâ, âsnippet: edit any contentâ
11. Snippet: Basic Usage
1. Site builder:
â Create a snippet node e.g. âAbout Usâ with initial placeholder content
â Nodeblock automatically creates a new block of the same title
â Place new âAbout Usâ block in region using block admin interface
â Set block title to â<none>â so that title comes from snippet node instead
2. Client:
â Edit âAbout Usâ block content via contextual link or content overview page
12. Snippet: Views Setup
1. Create new snippet node for view header
2. Create a new view e.g. âLatest Headlinesâ block display
â Unformatted list of node titles filtered by âArticlesâ & âPublishedâ
3. Add header
â âEntity: Rendered Entityâ
â Enter node id of previously created snippet
4. Save view
5. Add new views block âLatest Headlinesâ to region
â Set block title to â<none>â so that title comes from snippet node instead
13. Now, if you apply this consistently ...
â Client should have complete editing control
over all content
â You as site builder or developer can sleep
easy knowing that thereâll be fewer problems
and questions
14. Bonus Extra
How to provide single page content editing for multipart
page elements like âŠ
â Group of calls to action
â Group of buttons
â Social media follow links
â Slideshow / carousel
â Etc ...
Client editors shouldnât have to
edit each node separately!
15. Two Options
Thereâs at least two decent options I know of:
1. Field collection
â Popular
â Relatively easy to setup, configure & theme
2. Inline entity form
â More low level / technical
â Will be used as backend for âfield collectionâ in D8
16. Other Lesser Options
Ordering modules:
â Weight, Nodequeue or DraggableViews modules
â Can create a page for client authors to change order
â Still not âone-pageâ editing / ordering solutions
17. Demo: Bring it all together
âFollow Usâ block
â New content type
â Nodeblock so it can be used as block
â Multi-entity creation / editing / ordering on one page using field collection
â Template overrides (per collection) possible
Adds up to a faster, easier client editing experience!
18. Lastly ...
â Package these techniques up for easy reuse
with D8 CMI and/or D7 features!