Forum Discussion

jmurray's avatar
jmurray
Champion
14 years ago

Embed a Default Component in a Custom Component?

Is it possible to embed an existing component in a custom component?  If so, what is the code for this action?  I want to use a javascript if/else statement that looks for a node id to prohibit certain default components from showing up on some categories while keeping them on others.  I know the javascript.  I'm just not sure if I can call up an existing component somehow inside of a custom component.  I would prefer to avoid using the REST API and just building new modules if possible.

2 Replies

  • Hi
    it must be possible ... You need to know the default component's id (you can find it in the Page XML structure : for instance the announcement <component id="common.widget.annoucement"/>)
    and add a @ at the beguinning ... So the syntax should be:

    <@component id="common.widget.announcement" />

    hope this helps
    JC