Share content across subsites in Plone: cultact.subsite

584 views
515 views

Published on

Presentation at Plone Open Garden 2014 for the cultact.subsite content syndication toolkit. See source code + README at https://github.com/cosent/cultact.subsite

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
  • Simplifying content lifecycle management by using a proper layout of site structures. The presented package and setup is an excellent example how flexible Plone can be configured to customer – and more important – user demands. This improves the overall experience for different audiences.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
584
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Share content across subsites in Plone: cultact.subsite

  1. 1. cultact.subsite Guido Stevens guido.stevens@cosent.nl www.cosent.nl Social Knowledge Technology
  2. 2. Sharing Content between subsites
  3. 3. Twin Sites
  4. 4. Shared Content
  5. 5. URL rewrites # shared user folders rewrite ^/profielen/$ /profielen permanent; rewrite ^/profielen(.*) /VirtualHostBase/http/$server_name:80/ka/VirtualHostRoot/profielen$1 last; # livesearch all content rewrite ^/livesearch(.*) /VirtualHostBase/http/$server_name:80/ka/VirtualHostRoot/livesearch$1 last; # serve subsite rewrite ^/(.*) /VirtualHostBase/http/$server_name:80/ka/maastricht/VirtualHostRoot/$1 last;
  6. 6. cultact.subsite ● request marking ● content containers ● assignment behavior ● catalog & collections ● canonical URL SEO
  7. 7. Request Marking ● Inspired by plone.theme ● before_traverse hook maps request SERVERNAME to subsite ● request.set('in_subsite', chosen) ● Marks request with subsite-specific browser layer So? ● body class=”subsite_maastricht” CSS and Diazo rules ● Full custom theme registered for subsite layer possible <drop css:theme=".only-subsite-maastricht" css:if-not-content="body.subsite-maastricht" />
  8. 8. Content Containers ● dexterity.container ● Inspired by Lineage ● INavigationRoot ● ISite ● Very little content here – subsite-local advertisements – subsite-local contact info
  9. 9. Assignment Behavior ● Dexterity behavior to map shared content to subsites ● subsite_home – “main” subsite – single choice ● subsite_syndication – “default visible in” subsites – multi choice ● Used to power browser query logic – default: request.in_subsite in context.subsite_syndication – other: request.in_subsite != context.subsite_home
  10. 10. Catalog & Collections ● Catalog indexes – subsite_home – subsite_syndication ● Collection criteria – subsite_home – subsite_syndication ● MultisiteCollection behavior – override Collection to not force INavigationRoot path query
  11. 11. Misc Overrides ● override plone.app.layout.links.viewlets.CanonicalURL – point to “home” subsite virtual URL for shared content ● override Products.Doormat viewlet – show correct footer on shared content – uses request marker to retrieve “right” Doormat ● Need to override search in your own custom code
  12. 12. Sharing Content between subsites

×