Search code examples
magnolia

Example on how to reuses areas in magnolia?


I am a little bit confused. How do we reuse areas from another page? Lets say I created an article in an articles area on my index page. How do I display that same content in another page?

Ive read the following https://documentation.magnolia-cms.com/display/DOCS53/Reusing+area+content

Seems kind of complex. I dont understand the pom file.

Cant we acccomplish this purely in light modules? If not, could someone show me an example of a simple content reuse scenario?


Solution

  • Yes you can do it purely w/ light modules. Look at this article. Example there is custom "quotation" app and the quotes you create you can render and reuse in as many different pages/page-types you want.

    However it is slightly different than what you ask. In your question you want to reuse content from the page, which is also possible (you just need to address that content and feed it to appropriate cms tag in your page template (you can forget all about maven and so on, just focus on your templates). In the example I point you to, you create custom app for stories, articles or any kind of content and then just refer it from all pages where you want to render it. This allows you not only to share the content, but also separate it's editing from the page structure which makes life of editors easier in long run.