My last Mura post was on how to include Ajax functionality in a Mura site. In my case, I needed to add this functionality to the home page (very topmost in my page hierarchy), and I did so by placing a component into that page's "main content" area. Well, this was all find and dandy until I realized that, because my home page is being inherited by many of the children pages (due to some sidebar links I wanted to cascade down), my ajax component was ALSO being inherited. No bueno. The topic of this post, then, is how to add a component to a page and not have it to be inherited by child pages.
The short answer: Rather than add the component via the "content objects" tab, output the component within your page content manually.
Since page content is not inherited by children (only items added via the "content objects" tab are inherited), this approach ensures that the component is only rendered for that page alone.
Not much to this, really. We will utilize a Mura command called "dspObject" to perform the manual rendering of the component. dspObject requires the ID of the component you want to render, so you'll need to grab that first thing. To find the ID, go to Components, edit the component you're interested in, click on the "Advanced" tab, and copy the Content ID value.
Lastly, we output the component in the page content we're interested in. Just add
to the page content where you want the content to appear.
That's it! Now your component will appear within your page, but will NOT be inherited by any child page.