How do I use templates dynamically?
Posted: 22 May 2008 09:38 AM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  12
Joined  05-07-2008

Hello. I can’t seem to wrap my brain around this problem.
I have quite a large website with a navigation and sub navigation. First time using EE.

Currently, I am creating a new template for every weblog (content page), I create. What I would like is to use 1 template for my “About Us” section which contains at least 5 or 6 sub-pages. How can I do that if I state in my “About Us” template, which weblog to show?

Example code in my About Us Template:

{exp:weblog:entries weblog="rave_content" url_title="our_mission"}

Basically, I only want 1 entry of my “rave_content” weblog to show up per page. But to do this, I would need to create a new Template and change the “url_title” property every time. Is there an easier/better way to do this? Any help or resource on this would be greatly appreciated.

Thanks!

Profile
 
 
Posted: 22 May 2008 09:43 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

You can simply provide the url_title in the, well, URL, like so:

http://example.com/index.php/site/template/our_mission
http://example.com/index.php/site/template/foo
http://example.com/index.php/site/template/bar

The template would be “template”, containing

{exp:weblog:entries weblog="rave_content"}

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 22 May 2008 12:50 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  12
Joined  05-07-2008

Thanks Ingmar, pretty simple concept, but just couldn’t figure it out. Thanks again!

Profile
 
 
Posted: 22 May 2008 01:20 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

Glad it was that easy smile

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62610 Total Logged-in Users: 12
Total Topics: 77108 Total Anonymous Users: 9
Total Replies: 416358 Total Guests: 148
Total Posts: 493466    
Members ( View Memberlist )
Newest Members:  redarcEbbyWolfCIfan1000grayskwrlcornernotetriplexwengbaoshanGenki1gabewellsGlauco