miko09
miko09

Reputation: 1

Magnolia CMS: inherited component customisation

Is there any possible solution to customise the inherited component in magnolia? Where in if the child page inherits a component, the child component has the capability of editing it?

Upvotes: 0

Views: 374

Answers (1)

Jan
Jan

Reputation: 4369

If the component is inherited, it means it doesn't really exist in the current page, but only in one of the parent pages. To be able to edit it, you would have to create an edit button that would craft the same request that is created for editing the component on the page into which it really belongs.
On top of that you should also check whether current user has actually permission to edit such parent page and thus edit component in that page otherwise you might create the link, but user would still not able to save their changes.

In other words, to do as you wish, you would be required to do some custom development either in page editor or in the template of affected component (depending on how close you want your custom edit button to resemble the rest of Magnolia) and I'm not sure the effort is worth the reward in this case.

If you still want to aid your user with minimal effort, you can in edit mode generate extra link from the component template that would point to the page to which this component belong. That way user doesn't need search for page to which the component belongs, determining parent page of the component from within its template and generating link to it is easy enough and you also side step the security question as link will just take user to the page and page editor will take care of security and would determine whether editing is permissible and edit button should be displayed or whether user has read only permission for the page and its components.

Upvotes: 2

Related Questions