Hi,
I admit I have no idea what beginner tutorial you're referring to, so I might repeating things here.
If you don't change anything in the View, $_layout has a value of "default" => default.php in the component's views/xxx/tmpl/ path
'xxx' is derived from the view's classname, i.e. for com_
content you can have;
archive,
article, category, frontpage, and section.
Their view classes are called:
ContentView
Archive,
ContentView
Archive, etc.
Each view can set a different layout (basically per $task and set by the controller). There are for instance the well known "blog" layouts (blog.php) used for the category or section views of com_content.
A "blog" layout in J! usually consists of the subtemplates blog_item and blog_link, i.e for HTML output:
- view =
section ( ~ com_content/views/
section/view.html.php)
- _layout = "
blog" ( ~ com_content/views/
section/tmpl/
blog.php
using $view->display( null ) loads "
blog.php"
using $view->display( '
item' ) loads "
blog_
item.php"
Once you code a Controller it (should) assign different views and layouts and call display() as needed for the incoming request.
Easy
Hope this helps.
Have fun,
CirTap
jalil wrote:
ok, i get it, $tpl=null is actually default, not a permanent assignment !
thanks !
so $this->_layout defaults to index.php of the site template ?
or is this template for displays in contents only ?
meaning to say, we can have our own customised content display ?
i'm a little confused as you can very well see.
You can have programs written fast, well, and cheap, but you only get to pick 2 ...
"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams