Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th March 2010, 11:31
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default ISPC3 Theme/Template

Hey all,

I'm working on a new theme for ISPConfig3 and was working on using css classes for the left menu and got a bit of a problem with it.

I can't find unique var name I can use to define each menu item individually.
I tried cheating and using <tmpl_var name='title'> and got some success until I noticed the Monitor menu and the left side bar shows Server to Monitor with some screwed up text in the class name breaking html.

/usr/local/ispconfig/interface/web/themes/{template}/templates/sidenav.tpl.htm
.
.
.
<li class="<tmpl_var name='title'>">
<tmpl_if name="link">
<a href="#" onClick="loadContent('<tmpl_var name='link'>')">
</tmpl_if>
<tmpl_var name="title">
<tmpl_if name="link">
</a>
</tmpl_if>
</li>

Is there a var name that contains unique names that can be used for css. ie ones without spaces etc.
Or is there a way to know what template vars are available. so far it appears the language text is possible but not sure what else, especially one for the combo server select box I have a problem with.

Tremors.
Attached Images
 
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
Sponsored Links
  #2  
Old 30th March 2010, 11:51
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

I've noticed another issue.
Most if not all buttons to add are using the same class name which is fair enough if you want the same icon but not if you want to change it.
Since this is a template and not part of a theme, makes it hard to change it but not lose the changes over an upgrade as I believe these files would be overriden right?

root@anuke: /usr/local/ispconfig/interface/web# find . -exec grep -H "iconstxt icoAdd" {} \;
./client/templates/client_template_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('client/client_template_edit.php');">
./client/templates/client_edit_limits.htm: <button class="positive iconstxt icoAdd" type="button" value="Add additional template" onClick="addAdditionalTemplate();"><span>Add additional template</span></button>
./client/templates/resellers_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('client/reseller_edit.php');">
./client/templates/clients_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('client/client_edit.php');">
./sites/templates/ftp_user_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/ftp_user_edit.php');">
./sites/templates/database_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/database_edit.php');">
./sites/templates/shell_user_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/shell_user_edit.php');">
./sites/templates/web_subdomain_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/web_subdomain_edit.php');">
./sites/templates/web_domain_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/web_domain_edit.php');">
./sites/templates/web_aliasdomain_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/web_aliasdomain_edit.php');">
./sites/templates/cron_list.htm: <button class="iconstxt icoAdd" type="button" onClick="loadContent('sites/cron_edit.php');">
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #3  
Old 30th March 2010, 21:04
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,654 Times in 4,463 Posts
Default

All files that are in a template folder will get replaced on updates.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 1st April 2010, 12:12
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

yeah well i figured that would be the case.
what about naming convensions used as Add website, Add new FTP user, Add blah blah.. all use the same class name, can we in future have a different class for each?

Also, you didn't answer my questions about unique var names since atm, I have to use <tmpl_var name='link'> which means in the css i have to use :
#submenu li.sites\/web_subdomain_list\.php a { background-image: url("../../images/domain-sub-icon.png");background-repeat:no-repeat; padding-top: 0px;}

etc. reaaally ugly and bad.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #5  
Old 3rd April 2010, 12:15
mike_p mike_p is offline
Senior Member
 
Join Date: Mar 2010
Location: Surrey, England
Posts: 140
Thanks: 9
Thanked 28 Times in 17 Posts
Default

You could use the class attribute after all.

Remember that HTML allows space-seperated mutiple classes for a single entity.

The css rules allow mutiple class selection.

so if your class = ''Subdomain for website"
that is equivalent to three seperate classes

your css could specify a rule for all three classes being together:
#submenu .Subdomain.for.website {...}
Reply With Quote
  #6  
Old 3rd April 2010, 12:32
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

Yep, I used the var 'title' which i used the Subdomain.for.website method in the css, but this fails badly when rendering menus which have the pulldown combo like the server selection in the Monitor section. So ended up using the link instead.
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #7  
Old 29th May 2010, 14:29
mike_p mike_p is offline
Senior Member
 
Join Date: Mar 2010
Location: Surrey, England
Posts: 140
Thanks: 9
Thanked 28 Times in 17 Posts
Default

I've come back to this becuase I'd like a cleaner solution to styling these pages.

So I've edited each of the module.conf.php pages and added to each of the $items array a new field called "html_id"
eg within monitor/lib/module.conf.php for the raid_state menu item
Code:
$items[] = array( 'title' 	=> "Show RAID state",
         'target' 	=> 'content',
         'link'	=> 'monitor/show_data.php?type=raid_state',
	 'html_id' => 'raid_state');
then in my sidenav.tpl.htm I've changed the items loop to
Code:
 <tmpl_loop name="items">
    <li <tmpl_if name="html_id"> id='<tmpl_var name="html_id">' </tmpl_if>>
      <tmpl_if name="link">
        <a href="#" onClick="loadContent('<tmpl_var name='link'>')">
      </tmpl_if>
      <tmpl_var name="title">
      <tmpl_if name="link">
        </a>
      </tmpl_if>
    </li>
  </tmpl_loop>
In my css I can now assign an icon using (eg) #raid_state to select the item.

If anyone's interested (and Till and/or Falko agree!) I'd be happy to include these changes in svn.

Last edited by mike_p; 29th May 2010 at 14:34.
Reply With Quote
  #8  
Old 29th May 2010, 15:55
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 13 Times in 11 Posts
Default

Yeah that would be ideal method really but since the ispconfig3 upgrades are a little brutal and overwrite almost everything you changed, you have to keep backup copies and diff them in case they've added something to the page which a backup&restoring of your modified file would restore back to the old copy.
So i did it my way only for easy upgrade reasons only.
Would be nice if the ispc team styled everything a little better.

What you did was good work Mike, could try chattr +i on your files during upgrade to prevent overwriting and see how it goes. I know it doesn't work on custom postfix main.cf as complains before continuing, i know coz i tried it.
For some reason ispc3 upgrade screws my postfix configs so i have to always back it up.

it truely needs questionable sections for upgrades like templates, each service and so on..
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #9  
Old 29th May 2010, 16:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,654 Times in 4,463 Posts
Default

Quote:
Yeah that would be ideal method really but since the ispconfig3 upgrades are a little brutal and overwrite almost everything you changed, you have to keep backup copies and diff them in case they've added something to the page which a backup&restoring of your modified file would restore back to the old copy.
That depends on how you work with a open source project. mike_p for example works actively with the ispconfig project and commits his changes and fixes back to the source tree. You decided to work only on your own without contributing to the ispconfig project, so your chnages does not go into the ispconfig sources and thats why you have ptoblems with overwritten files.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #10  
Old 29th May 2010, 16:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,654 Times in 4,463 Posts
 
Default

Quote:
Originally Posted by mike_p View Post
If anyone's interested (and Till and/or Falko agree!) I'd be happy to include these changes in svn.
Sure. If they do not break the exsting themes, then please commit them to svn trunk.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newb: Is there an issue between Drupal zen theme and ISPC3? smartin Installation/Configuration 2 27th January 2010 14:19
Newb: What will 'work' with ISPc3? Slowhand Installation/Configuration 10 26th June 2009 10:14
ISPC3 with RSA key generation djtremors Feature Requests 2 31st May 2009 13:08
How should billing work in ISPC3 redray Developers' Forum 2 6th February 2009 21:23
ISPC3 - pure-ftpd archerjd Developers' Forum 1 3rd January 2009 11:12


All times are GMT +2. The time now is 23:04.


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