Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th May 2012, 16:28
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default Extending/Restructuring of the "Theme-Engine"

Hi Devs,

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
from
ISPC_WEB_PATH./$module/templates/*
to
ISPC_WEB_PATH./themes/theme_name/templates/$module/*
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
ISPC_WEB_PATH./themes/tmpl_var name="theme"/

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.
Reply With Quote
Sponsored Links
  #2  
Old 15th May 2012, 15:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 17th May 2012, 19:11
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default

I just thought a little bit more about the "problem".

In a module file e.g. dashboard/dashboard.php
$app->tpl->newTemplate("templates/dashboard.htm");
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.

-> themes/*theme-name*/templates/dashboard.htm

In this case templates must be moved to the theme-folder but no modifications to modules are necessary.
Reply With Quote
  #4  
Old 18th May 2012, 12:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,509
Thanks: 815
Thanked 5,269 Times in 4,130 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 18th May 2012, 13:18
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default

Quote:
Originally Posted by till View Post
... dont contain theming information or styles ...
The files in *module*/templates/ are theme files which define structure by using fieldsets, divs, hr and other html tags.
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.
Reply With Quote
  #6  
Old 18th June 2012, 19:00
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default

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.

@Till:
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.
__________________
Christian Foellmann

OpenSource-Projects - GitHub-Projects - SVN-Mirrors on GitHub - Foe Services
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.