PDA

View Full Version : Diifferent layouts for different custom pages


Tini72
26th of July 2008 (Sat), 08:05
I like the idea of custom pages a lot but now I figured out a problem which I can't solve by myself. I hope althought it's holiday time now that there is anybody out there who could help me a little.

I want to create a custom page which is different in layout from my other custom pages. That means this custom page would need a different custom template (call it custom_b).

I have already created that custom_b template and put it into the custom template folder but I can't get this to work.
Changing $currentpage = "custom_a"; to
$currentpage = "custom_b"; doesn't change anything. Still the custom_a template is used.

Quite at the end of empty.php there is a code line like

ob_start();
@include ("./" . $custom_a_content);
$ee_all_html = ob_get_contents();
ob_end_clean();

I suppose this is responsible that I can't use my custom_b template. But changing this to custom_b_contet simply gives my a blank page.

Does anybody can help me how being able to use custom_b template beside the custom_a template?

Any help is welcome! Thanks.

Tini

Cyclist
26th of October 2008 (Sun), 11:57
Does anybody know how to solve that? I need this as well.

jeronimo
26th of October 2008 (Sun), 13:09
I think you have to set the custom_b template in the admin panel as well.
Admin panel -> styles -> then down the page to custom templates.

There is a text field where you can include the link for cutom_b

(not shure if this works)

Cyclist
26th of October 2008 (Sun), 16:03
I think you have to set the custom_b template in the admin panel as well.
Admin panel -> styles -> then down the page to custom templates.

There is a text field where you can include the link for cutom_b

(not shure if this works)

Thanks for your advice but it doesn't work like this.

meanwhile I got a second custom template to work but not a third.

What I did: I copied all custom_a appereances of Custom_a in basecode/SCRIPT_get_styledata.php and changed it to custom_b (and custom_c).

I copied the template and renamed it to custom_b and custom_c;

I copied the empty.php and changed the settings to custom_b and custom_c.

The custom_b ist working but not the custom_c and I don't know why.

I am not sure if Pekka still looks around here (he hasn't been 'writing in the EE Forum for weeks now...) but if he does it would be great if he could say if something like this is possible at all. Thanks.

jeronimo
27th of October 2008 (Mon), 03:22
Pekka is a realy busy man. He will look around every now and then, be patient :)

Tini72
27th of October 2008 (Mon), 09:30
I am still looking for a solution for my photo site as well. In my case I just want to use different style(css) files for each custom page (tipps, imprint, mail). I am not a programmer so I don't know how to change the code to get this working. Is there a way to define the css file (besides the EE standard css) in empty.php and use that information in the custom_a template ? The extra css file should be different for each custom page based on empty.php. Maybe anybody has some idea.

Tini72
27th of October 2008 (Mon), 17:19
Meanwhile I found a solution by myself.

in the empty.php I added (just before where the content goes to);
ob_start();
$custom_css = "test.css";
print trim($custom_css);
$custom_css_html = ob_get_contents();
ob_end_clean();


in the custom_a template I called the custom css like this
<link rel="stylesheet" href="/css/<?php print $custom_css_html; ?>" type="text/css" />

Maybe a php expert can check if it's safe calling the css file like this or if there is a better way of doing it.