Display template group name and template name in template?
Posted: 08 April 2008 12:50 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Hey guys,

I was wondering if there was a way to display the current template group name and template name in a template?

EG: This page is using {template_name} in {template_group_name}.

Cheers

Moved by Moderator

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 08 April 2008 01:15 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

I don’t think so. Personally, I’d be most interested in {template_id}, but see what Rick had to say in repsonse to my feature request.

 Signature 

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

Profile
MSG
 
 
Posted: 08 April 2008 03:19 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Ok after looking through the code I think I may have a solution that returns:

template_id
template_name
template_group
template_group_id

turning it into a plugin now smile

Care to test?

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 08 April 2008 04:57 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12251
Joined  04-29-2002

Sure.. I can test it this morning..

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 08 April 2008 05:31 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

Just gave it a quick run, and it works nicely, including multiple sites (using path.php, not the MSM) and using default values for both template_group and template (using something like example.com/index.php/url_title, which I generally tend to avoid.) Works with categories, too.

 Signature 

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

Profile
MSG
 
 
Posted: 08 April 2008 05:34 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Excellent… I made sure every sql statement had a site id clause smile

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 08 April 2008 08:10 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23477
Joined  05-20-2002

Nice one- want me to shift this down to plugins?  Or close it out here?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 08 April 2008 02:31 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006
Robin Sowell - 08 April 2008 08:10 AM

Nice one- want me to shift this down to plugins?  Or close it out here?

Yeah this one could be o\moved to plugins now I have the solution smile

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 08 April 2008 03:44 PM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Of course you don’t even need this plugin if you use some variables in you embed

{embed="_includes/.head" tg="template_group" t="template"}

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 08 April 2008 10:12 PM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

Yes, but that’s hardcoding them, something I alway try to avoid.

 Signature 

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

Profile
MSG
 
 
Posted: 13 April 2008 05:50 PM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1076
Joined  01-24-2006

Hey guys,

In response to this thread I have released LG Template Info with full documentation.

As usual its available on my site: LG Template Info - Display ExpressionEngine Template information in your templates.

Enjoy

 Signature 

Nominate LG Addons in the Mashable Open Web Awards!


Newism - Newcastle Web Design & Development


LG Better Meta now w/ Sitemap Meta & XML Generator | LG Polls | LG .htaccess Generator

Profile
 
 
Posted: 13 April 2008 10:14 PM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

IV’e test it, and it wokrs fine. Nice work, Leevi.

 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 09:33 AM
Total Registered Members: 64491 Total Logged-in Users: 60
Total Topics: 81032 Total Anonymous Users: 25
Total Replies: 436055 Total Guests: 281
Total Posts: 517087    
Members ( View Memberlist )