Extending/Restructuring of the "Theme-Engine"
I am developing a theme for ISPConfig 3.0.4.x (http://www.howtoforge.com/forums/showthread.php?t=57106) with a higher impact on the layout than "just" the files in "themes/theme-name/".
I would propose a "little" change of the "theming-engine" which would make the ISPC-frontend more flexible and the file-structure more logical.
move template files
ISPC_WEB_PATH./themes/tmpl_var name="theme"/templates/$module/*to not break all module files the class newTemplate must be changed to reflect the base-dir of
What do you as experienced php-developers think about the complexity of this modification?
Would be great to not "hack" the template files of all modules for the new theme and by this breaking the default-theme.
First, that would require quote some work, so that change is a rather big one.
Second, if you want to modify a template, you have to do it once right now. With your proposal, you have to modify it for each theme.
I understand your point, but I'm not sure if this is a good idea.
I just thought a little bit more about the "problem".
In a module file e.g. dashboard/dashboard.php
loads the template-file from dashboard/templates/dashboard.htm
public function newTemplate($tmplfile)
"just" needs to add "(ISPC_WEB_PATH.)../themes/.$_SESSION['s']['theme']./" to the $tmplfile-var.
In this case templates must be moved to the theme-folder but no modifications to modules are necessary.
Modules in ISPConfig are self contianed, this means that they shall have their own templates folder for their web forms. These templates are not part of the theme as they should exist only once for all themes and dont contain theming information or styles, otherwise it would be nescessary to edit every theme when we add a new field to a web form.
Just an example:
If you maintain a theme for ispconfig were then you would have to change your theme for every new feature that we add in ispconfig or your theme will stop to work corrcetly. And you will have to maintain different versions of your theme for ecah ispconfig version, I dont think that this is what most users want.
Nevertheless we can add themes/*theme-name*/ to the paths were the template engine searches for files, but I'm not sure if this is a good idea as many users will start complaining here in the forum if they updated their ispconfig and it stops working then due to the fact that the theme does not support new features.
For me all tags except for framing tags (like <li>) of data output should be considered theme. Especially <br> is totally killing themability -> not best practice.
The module provides vars for output in various formats used in the theme.
I hope you understand my critique the way it is intended. As constructive input. I am really interested in ISPC and just trying to help improve it.
Since I have not heard back from you after my mail to devAtISPC.de let me say that I would be happy to do the major work for this modification as long as someone else provides the mod for the php class(es).
Beside the modification I would like to smooth out the default theme. I found a lot of minor inconsistencies and errors in the template files while rebuilding them for my theme.
Till was so nice to implement a little hook (http://bugtracker.ispconfig.org/inde...s&task_id=2289) to be release with 3.0.5 making it unnecessary to overwrite any template files of modules by custom themes.
Is it also working for dashlets?
I have another idea to make the themability one step better:
in the dashboard.php dashlets are assigned to one of 2 columns. How about scraping the columns and defining the position by css?
That would make it possible for custom modules to post dashlets to the dashboard without hacking the dashboard.php.
It should work for any kind of files that are processed by the templating engine.
how about making the login module/page a lot more flexible by using themes/.$_SESSION['s']['theme']./templates/login.tpl.htm instead of main.tpl.htm for the login page?
After login, only the menus and the content is loaded into the page with ajax. So if you have a main template for the login page that differs from the normal main template, you will not see the normal main template as it is not loaded at all.
That is not good. So it is really not easy changing the login. :(
Two remarks about your switch:
|All times are GMT +2. The time now is 16:05.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.