Different Template File for Inner Pages

Discuss the development and implementation of Joomla! 1.0.x templates here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
User avatar
Design ICU
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Feb 26, 2008 4:24 pm
Location: Upstate New York
Contact:

Different Template File for Inner Pages

Post by Design ICU » Tue Feb 26, 2008 5:25 pm

Hello. First post here. I'm an experienced designer and Web standards coder working on my first Joomla! project.

I've followed the instructions for setting up a template and so far so good. However, I actually have two page designs for the site I'm working on: one for the home page and one for the inner pages. (The header is slightly different on each.)

I can't find instructions on-line for getting Joomla to use one template file for the home page and another file for all other pages. Any help appreciated. URLs to appropriate pages would be great.

Thanks in advance,

Sean
Sean O'Dwyer › Web Site DesignerThe ICU Blog

 
User avatar
fastnet
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 187
Joined: Wed Jan 16, 2008 1:29 pm
Location: United Kingdom
Contact:

Re: Different Template File for Inner Pages

Post by fastnet » Wed Feb 27, 2008 4:06 pm

Hi Sean

When logged in, trying the following:

From the top menu click: site > template manager > site templates

This is where your templates are and you can choose to change to another default one.

Here, you can also click another templates radio button (leaving your homepage as default) then click 'Assign' (top right) - and choose which sub level pages this other template is used instead of your default homepage template.

Hope this helps...

cheers
fastnet
Joostrap - Bringing the Bootstrap Awesomeness to Joomla!
http://www.joostrap.com
Fastnet Web Design
http://www.fastnetwebdesign.co.uk
Ex OSM Capital Committee Chair

User avatar
Design ICU
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Feb 26, 2008 4:24 pm
Location: Upstate New York
Contact:

Re: Different Template File for Inner Pages

Post by Design ICU » Thu Mar 06, 2008 5:20 am

Thanks, fastnet, that was really helpful. It gets me 80% there.

I've assigned my INNER PAGE template to all inner pages, just as you described. However, for stories listed on the home page—when you click those and are brought to their dynamically generated page, I'm still getting the HOME PAGE template.

I think the problem is that only pages with menu items show up in that screen, and these news stories will not have menu items. Is there a way to assign my INNER PAGE template to stories like this, by category perhaps...

Thanks again,

Sean
Sean O'Dwyer › Web Site DesignerThe ICU Blog

User avatar
Design ICU
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Feb 26, 2008 4:24 pm
Location: Upstate New York
Contact:

Re: Different Template File for Inner Pages

Post by Design ICU » Wed Mar 12, 2008 6:29 pm

So I have narrowed this down. Here's an example of what I'm talking about...

A news article is available from two places on the site...

1) It's listed on the home page so you can click the headline there to read the full story;

2) It's listed in (section) MAGAZINE and in (category) News so if you go to the news page, you can also click on the headline there to read the full story.

I have five templates running on the site: one template for the home page and one template per each of four main sections: MAGAZINE, FOR SALE, REGISTER, and MORE.

My dilemma is that depending on how you get to the story (i.e. depending on which of those two links you click) a different template is applied to the story.

If you get to the story by clicking the link on the home page, the story is displayed using the home page template. Whereas, if you get to the story by clicking the link on the MAGAZINE>NEWS page the story is displayed using the magazine section template.

So even though the story is listed under MAGAZINE>NEWS it does not automatically take on the MAGAZINE template. This seems really stupid to me. It should display using the template for the category to which it's been assigned—or there should be an option when editing the content item that allows me to pick which template it should use to display.

Is there a way to achieve this in Joomla 1.0?
Sean O'Dwyer › Web Site DesignerThe ICU Blog

User avatar
Design ICU
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Feb 26, 2008 4:24 pm
Location: Upstate New York
Contact:

Re: Different Template File for Inner Pages

Post by Design ICU » Tue Mar 18, 2008 5:34 pm

bump — no takers?
Sean O'Dwyer › Web Site DesignerThe ICU Blog

madelman2
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 122
Joined: Tue Jun 19, 2007 3:52 am

Re: Different Template File for Inner Pages

Post by madelman2 » Tue Jun 03, 2008 5:56 pm

have you found any solution to this?

User avatar
Design ICU
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Feb 26, 2008 4:24 pm
Location: Upstate New York
Contact:

Re: Different Template File for Inner Pages

Post by Design ICU » Wed Jun 04, 2008 7:02 pm

No solution in Joomla so what I'm doing is checking the URL with some PHP in the master template. If it's such-and-such I show one header, if it's anything else I show another header. Here's the code...

Code: Select all

// grab page url
function curPageURL() {
	$pageURL = 'http';
	if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
	$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
	$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
		} else {
		$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
		}
	return $pageURL;
}

// check URL for header switching
$check4home = 0;
$checkURL = curPageURL();
if (strcmp($checkURL,'http://www.afloat.ie/afloat/index.php?option=com_frontpage&Itemid=1') == 0) {$check4home = 1;}
elseif (strcmp($checkURL,'http://afloat.ie/afloat/index.php?option=com_frontpage&Itemid=1') == 0) {$check4home = 1;}
elseif (strcmp($checkURL,'http://www.afloat.ie/afloat/index.php') == 0) {$check4home = 1;}
elseif (strcmp($checkURL,'http://afloat.ie/afloat/index.php') == 0) {$check4home = 1;}
elseif (strcmp($checkURL,'http://www.afloat.ie/afloat/') == 0) {$check4home = 1;}
elseif (strcmp($checkURL,'http://afloat.ie/afloat/') == 0) {$check4home = 1;}
else {$check4home = 0;}
And then the actual switching...

Code: Select all

if ($check4home == 1) {echo 'HEADER 1 HTML GOES HERE';} else {echo 'HEADER 2 HTML GOES HERE';}
This works for this site because the only difference between the home page design and the inner page design is the header. But it's a cumbersome solution that wouldn't work for all sites.
Sean O'Dwyer › Web Site DesignerThe ICU Blog

shenpika
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed May 30, 2012 6:44 pm

Re: Different Template File for Inner Pages

Post by shenpika » Tue May 21, 2013 1:44 pm

Hello I know you post this long time ago, did you get the solution for this , if you have can you let me know ? please :)

 

Locked

Return to “Templates & CSS - 1.0.x”