Hi, I already posted this help request in the Community Forum however i have not gotten a working answer. Any help with this is greatly aprpeciated.
This is my navigation:
Media In The News Media Releases Videos -Youth -Family -Communtiy Library Newsletter
Everything under Media uses the same template - Media/index.
There is a channel called content_page. Every page in the site has a content_page entry
On the Media template, i currently have this code:
{exp:channel:entries channel=“content_page”}
<h1>{title}</h1>
<div id=“body”>
{content}
{if entry_id == “131”}
{embed=“ignore_includes/in-the-news”}
{/if}
{if entry_id == “132”}
{embed=“ignore_includes/media-releases”}
{/if}
{if entry_id == “133”}
{embed=“ignore_includes/library”}
{/if}
{if entry_id == “134”}
{embed=“ignore_includes/newsletter”}
{/if}
</div>
{/exp:channel:entries}So for example, if we are on the library page, which has a content_page channel entry of 133, then it embed the template called library.
Each of the 4 templates noted have their own channel associated with it. For example, the library template starts off with:
{exp:channel:entries channel="library" sort="desc" dynamic="no"}{embed=“ignore_includes/videos”}..if either the youth, family or community pages is visited. And obviously the related content_page channel entry appears.
The first thing that comes to mind would be..
{if entry_id == “135”}
{embed=“ignore_includes/videos”}
{/if}
{if entry_id == “136”}
{embed=“ignore_includes/videos”}
{/if}
{if entry_id == “137”}
{embed=“ignore_includes/videos”}
{/if}.. where 135 is the content_page entry for youth, 136 for family.. and so on.
Now since each of those is loading the exact same template, this is obviously not how you would code this. I need to know how.
..
Now for the Videos channel, there is a field called vid_category. (This uses the ‘P&T Radio Buttons’ type (custon field from Pixel&Tonic;)).
This consists of the three options: Youth, Family, Community
So I have the Videos template which currently has this:
{exp:channel:entries channel="video" sort="desc" dynamic="no"}
<h2>{title}</h2>{vid_info}
<iframe src="http://player.vimeo.com/video/{vid_id}?title=0"></iframe>
{/exp:channel:entries}(I understand that 2. might not be requried based on what is placed for 1. (??))
I really appreciate any help on this.
Hi zedg,
It seems that you are looking for someone to help how to code your template. Unfortunately in technical support, we’re really here to help when something in EE isn’t work how it should be.
some places to find tutorials with using EE are:
Train-ee which has both classroom training and free web based tutorials. Mijingo Screencasts on EE. Online Classes/webinars
I am going to move your thread back to Programming and Development. Do check out the resources I linked above and don’t hesitate to post again as needed.
Sean
Everything under Media uses the same template - Media/index.
Firstly, why?
Why is each page using the same template… I believe this would be much easier and clearer for you if you had separate templates for each channel.
I think your approach is flawed. I think you are trying to build dynamic content into a template based around your static content. I think you would be better to bring the static content into each of the templates for your dynamic content.
There are at least 2 different ways to handle this, depending on what you are trying to achieve. - You could use the Pages module to specify the URL and select a specific template - On your separate templates for each channel you could have the static content pulled in at the top with a {exp:channel:entries entry_id=""} tag
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.