From: yawstick <yaw...@ch...> - 2005-01-25 03:03:42
|
I've learned quite a bit about theme.php theme.tpl style sheets and even found the function getElementCatId in fatcat. I have been able to change style sheets and even the logo image but had to do it using the page id. Most of this is derived from the example of Ton Oosterhoff, which included the syntax for retrieving the page id and page category. The page category one always comes back empty, as I have added $THEME varibles to show the results in the web page. So if you could enlighten me as to the proper calls to get the page category for the current page I would greatly appreciate it. $THEME["is_user"] = $_SESSION['OBJ_user']->isUser() ; $THEME["page_id"] = $_SESSION["SES_PM_page"]->id ; // get the page id: $my_pageid = $_SESSION["SES_PM_page"]->id; ******* the line below always comes back empty could comment on the correctness of the syntax ***** $THEME["page_category"] = $_SESSION["OBJ_fatcat"]->getElementCatId($my_pageid) ; // get the category of this page: //$my_category = $_SESSION["OBJ_fatcat"]->getElementCatId($my_pageid); $my_category = $_SESSION["SES_PM_page"]->id; switch ($my_category){ case "3": $my_style = "page1.css"; break; case "6": $my_style = "midnight.css"; break; default: $my_style = "classic.css"; } // output it to the template... $THEME["my_style"] = $my_style; switch ($my_style){ case "midnight.css": $logo = "logo1.jpg"; break; case "modernist.css": $logo = "logo2.jpg"; break; case "classic.css": $logo = "logo.jpg"; break; } $THEME["logo"] =$logo; ?> |