0
votes

I have cq5 content page below content tree in crxde. The content page has a header, a footer and one component in the body section.

enter image description here

I am trying to get the only content that authored in that specific component (No header, No footer, No Edit bar of component)

I tried following, but it produced the whole page with header, footer and component.

<sling:include path="/content/site-content/disclaimers/risk-considerations.html" />

then, I tried this, there is no header, footer but it still displays Component edit bar.

<sling:include path="/content/site-content/disclaimers/risk-considerations.content.html" />

How could I achieve only returning authored content into another page?

1
You should use a reference component in your destination page and use the content of the source page. - Abhishek
@Abhishek User does not want to author any thing on the page, user just want to see the content that already authored on some other page. - Sri
That's the purpose of the reference component. To re-use existing authored content. When the source page content changes, it will reflect in the page with reference component. - Abhishek

1 Answers

0
votes

Based on what you need, reference component as Abhishek said fits your use-case. Given that you won't want to hardcode a path within a component or page you would use a dialog to get the path to HTML to include, reference component does that for you in addition to that your use-case of disabling edit-bar/behavior is taken care of within the component.

But in case you are constrained to use your existing approach, then to disable editbar you would need to update your component script to change the mode prior and post inclusion. You can refer to reference component for same. You can also refer to stackoverflow answers here and here