Thursday, May 5, 2011

Layout and CSS

One of the problematic points when I was developing the CMS BLOG with CakePHP was to define the tittle of the pages, and the layout and css uniforms.
CakePHP give us the posibility to change it in a intuitive way. First of all you have to add some code in the actions of the controller :

$this -->set ('title_for_layout', 'Name of the Blog');
This give us the posibility to use the Name of the Blog as the title of the page. Then we have to change the layout in the view folfer. If we name that layout default.ctp we don't need to specify that layout inside the controllers.

Inside the layout, default.ctp, we can indicate that we are going to use a CSS file. In that file we can specify the style of our blog.

No comments:

Post a Comment