[MGNLSTK-700] Prevent from creation of new content in footer when footer.editable is set to false Created: 04/Nov/10  Updated: 20/Jan/11  Resolved: 20/Jan/11

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: paragraphs
Affects Version/s: 1.3.5
Fix Version/s: 1.4.2

Type: Bug Priority: Minor
Reporter: Vivian Steller Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MAGNOLIA-3519 InheritanceContentWrapper.isInherited... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

On section templates it's still possible to create elements in the footer, even when footer.editable is set to false.

To fix this, in paragraphs/footer/footer.ftl change line 7 from:
if mgnl.editMode
to
if mgnl.editMode && model.root.def.footer.editable



 Comments   
Comment by Vivian Steller [ 04/Nov/10 ]

additionally one should prevent the user from editing any nested paragraph in the footer. You can include a simple check in your freemarker code that renders the content's editbar conditionally:

[code]
[#if mgnl.editMode && (!content.@handle?matches("/[^/]/footer/.") || model.root.def.footer.editable)]
...
[code]

Comment by Magnolia International [ 17/Dec/10 ]

Makes sense, but using a regex to check for this in the template... not so much
I'm sure we can find something a little more solid and elegant.

Comment by Philipp Bärfuss [ 21/Dec/10 ]

hm, I am sure that worked once as expected and that we shouldn't depend on the naming

Comment by Philipp Bärfuss [ 19/Jan/11 ]

I thought there is a mechanism to say a paragraph (in the includeTemplate tag) that it should not render edit bars. It should not be the job of each sub paragraph to take care of this (and bind it to the footer definition of the page.

Comment by Philipp Bärfuss [ 19/Jan/11 ]

it is in the footer.ftl (not the paragraph but the one included in the main.ftl) where we switch of the edit bars if the content is inherited:

    [#if footer.exists]
        [@cms.includeTemplate contentNode=footer.content noEditBars=footer.inherited /]
    [/#if]

But for some reason footer.inherited is always false and hence the edit bars are shown.

Comment by Philipp Bärfuss [ 19/Jan/11 ]

Fixed by MAGNOLIA-3519

Comment by Philipp Bärfuss [ 20/Jan/11 ]

The former changes have to get reverted.

Comment by Philipp Bärfuss [ 20/Jan/11 ]

All changes were reverted. Now that the fix for MAGNOLIA-3519 is not yet back-ported to Magnolia 4.3 I am removing the 1.3.x fix version.

Generated at Mon Feb 12 13:39:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.