17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1343 Views |
-
Is it better to change just CSS files or should I have 3 main Page Types?

20 February 2007 at 10:57am Last edited: 20 February 2007 11:03am
Hey guys.
On the site (www.fideam.com), I have three main sections (Company,Sience and Finance) witch differ solely in one css file.
I'm wondering what is better:
a)To have 3 main page types or
b)to have 1 main page type (aka Page.ss) and then define 3 childes in Layout folder (one for every section)?And how would I achieve this?With some custom function maybe?And if is there a way to not showing a PageType in CMS backend?
Tnx ;)
-
Re: Is it better to change just CSS files or should I have 3 main Page Types?

20 February 2007 at 12:19pm
If it really is just one CSS file, then doing something like this in the template would work. You'd need CSS files named the same as the URLs of the top-level pages
For example, if you're page is /company/, then you'd need to create company.css
<% control Level(1) %>
<link rel="stylesheet" href="mysite/css/{$URLSegment}.css" />
<% end_control %>Hiding a page-type in the back-end can be defined by creating a canCreate() method on the appropriate class.
To disable the built-in classes, do it this way: since all the built-in types are sub-classes of Page, you could define this method on class Page: this would mean you could only create pages of type Page.
function canCreate() {
return $this->class == "Page";
}
| 1343 Views | ||
|
Page:
1
|
Go to Top |


