Im not sure if what i describe below is the correct way to do things in EE, so any help is appreciated.
So i have one ‘main’ template that displays a channel - that has one field {content}.
{exp:channel:entries channel="content_page"}
<h1>{title}</h1>
<div id="body">
{content}
</div>
{/exp:channel:entries}Now what i want, is for another template to get embeded, ONLY if a specific entry is being displayed.
So something like this:
{exp:channel:entries channel="content_page"}
<h1>{title}</h1>
<div id="body">
{content}
{embed="activities/events"}
This would only get embedded if a specific entry ('entry id?' or 'page?') is being displayed.
</div>
{/exp:channel:entries}Where the template called ‘events’ would consist of code such as:
{exp:channel:entries channel="whats_happening" sort="asc"}
<h2>{title}</h2>
<p> {event_outline}<br />
{/exp:channel:entries}
I have tried a few things to no avail, but i have no idea whether you would actually do it this way. Would you use an ‘if’ statement to embed a template, and if so can you have a template showing open/close channel:entries as above? Or would you use relationships?
..So rather than have separate templates for each channel, i simply embed a template that contains channel info, within the ‘main’ template.
??