1

I have been working hard for the past few months on our template framework update. For now everything seems well but I would like to hear from experienced Joomla devs if they see any issues with this.

From the beginning I wanted to have my own blank / empty template admin page to do what I like in there. No extra admin template js/css , no html/js overload. Just my own page to present the template admin form in the best way possible. A form that looks same in any Joomla version.
This is what I came up with

http://prntscr.com/378tyx

http://prntscr.com/378u3i

In order to achieve that I had to override the JDocumentHtml , ( THANK YOU to Donald Gilbert for great info )

This plugin helped explain the process http://extensions.joomla.org/extensions/style-a-design/templating/15611 but I did not like the eval use so I came up with my own version where in fact I read the original JDocumentHtml make new file inside plugin folder with its contents, replace strings , name the file than call it in plugin construct.

http://prntscr.com/378vfz

than I call the _fetchTemplate method extend file, which basically redirects the look for admin template index.php , to look inside the plugin folder for index.php

http://prntscr.com/378wna

All this works well . I made sure that if user is updating Joomla , the old copied class names are deleted , and when he goes inside admin again they are recreated with new JDocumentHtml class content. This way I make sure that we dont miss any changes or updates.

http://prntscr.com/378xfw

So if you had time to go trough this , please do give some info so that I can make sure that we did not miss anything.

Thank you!

  • 1
    Since you are already renaming the classes, why go through the trouble of copying over the old classes? Why not just create your new classes and extend JDocumentHtml? You get all the functionality and style of the base class and can just write your own overrides. – David Fritsch Apr 25 '14 at 21:00
  • @David That was my first intention , just extend but it did not work for some reason. Any examples to what you suggest? – Dan Apr 25 '14 at 21:28
  • 1
    Extending won't work because of the internals of JDocument and JForm. So from that aspect, this is the "right" way. – Michael Apr 26 '14 at 16:59
  • 1
    @Michael, yes , talked to Don about it and this seems like the only way. – Dan Apr 26 '14 at 17:24
2

I think I wanted to do something like this, i.e., extend Joomla class, using plugins. I decided not to pursue the idea but I did find the article "Extending Joomla! With Plugins" helpful.

If it helps great. If not, Oh Well.

Have fun!

  • thank you for the reply. I did went over that resource before we found the way we do now. The issue with that example is that we have no events, thus we are not extending but overriding the original joomla class. and with JDoccument there was a bigger issue and I think it triggers before everything else.. – Dan Apr 27 '14 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.