Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move hero to content, refs https://github.com/plone/Products.CMFPlone… #83

Merged
merged 1 commit into from
Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ New:

Fixes:

- Move hero to content
Issue https://github.com/plone/Products.CMFPlone/issues/974
[gyst]

- Add ``barceloneta-mixin-font`` to the registerless profile.
[pcdummy]

Expand Down
6 changes: 6 additions & 0 deletions plonetheme/barceloneta/theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<div id="mainnavigation">
</div>
</div>
<div id="hero" class="principal">
<div class="container">
<div class="gigantic">
</div>
</div>
</div>
<div id="above-content-wrapper">
<div id="above-content">
</div>
Expand Down
6 changes: 4 additions & 2 deletions plonetheme/barceloneta/theme/rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
<!-- move global nav -->
<replace css:theme-children="#mainnavigation" css:content-children="#portal-mainnavigation" method="raw" />

<!-- include view @@hero on homepage only -->
<after css:theme="#mainnavigation-wrapper" css:content=".principal" href="/@@hero" css:if-content="body.template-document_view.section-front-page" />
<!-- move hero to top -->
<replace css:theme-children="#hero .gigantic" css:content-children=".hero"/>
<drop css:theme="#hero" css:if-not-content=".hero" />
<drop css:content=".hero" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this works? Regarding http://docs.diazo.org/en/latest/basic.html#order-of-rule-execution <drop> rules are executed before <replace> rules. Looks to me, wether you'd have to remove the <drop> rule or add a method="raw" to your <replace> rule.
In either case you'd need to remove the method="raw" attribute of the replace-rule which copies the main content (also discussed here: https://community.plone.org/t/adding-html-snippets-with-diazo/1554/15 and #85 )

Sorry, didn't try out your pull, so this might be wrong...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me on a fresh coredev... I think the key is that I'm extracting the children - I guess that takes precedence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!
But then the Diazo docs are wrong... Maybe something has changed at some point...


<!-- full-width breadcrumb -->
<replace css:content="#viewlet-above-content" css:theme="#above-content" />
Expand Down