How to customize one portion of a DA skin, without needing to create your own skin.


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin » Skin

How to customize one portion of a DA skin, without needing to create your own skin.Last Modified: Oct 5, 2013, 9:20 pm
If you wish to only change one small aspect of a DA skin, you can do so by using the files_custom.conf file.  This file is related to the other 3 versions: files_user.conf, files_reseller.conf and files_admin.conf.  The only difference with the files_custom.conf is that is has priority over the other 3 conf files.  If the files_custom.conf exists and there is a duplicate record in the files_custom.conf, and the files_user.conf, the files_custom.conf value has priority, thus allowing you to customize what the value of the record is.   Note that the files_custom.conf does not exist in any skin packages, thus it will be safe from updates of DA.

For example, if you wish to customize the webmail icon at the the of the page in DA, this method would be useful.

1) First cd to the related skin directory that you want to customize.

cd /usr/local/directadmin/data/skins/enhanced

You'll notice the 3 conf files in that directory.

2) For this example, we're going to customize the webmail link.  This link exist in the 2 files:

header_bar.html
header_wide.html

which are 2 variations of the header of the page (some are full wide, others have a side bar).
The index DA uses to access those 2 files are found in the files_user.conf, and show up as follows:

HTM_HEADER_BAR=header_bar.html
HTM_HEADER_WIDE=header_wide.html



3) What we want to do, it copy those 2 files to our own versions, and then add the custom values into the files_custom.conf file.  The first step is to copy them to a name that isn't used, eg:

cp header_wide.html my_header_wide.html
cp header_bar.html my_header_bar.html

customize these 2 copied files however you wish.  In this example, change the

http://|HOSTNAME|/|WEBMAIL_LINK|

value to where-ever you want the link to point.  (In this specific example, it would only apply if you need a different HOSTNAME value because you can already change the WEBMAIL_LINK token with this guide).

4) Now that your custom files are ready to be modified, use the files_custom.conf to override the default values so DA see's your custom values.  Create the files_custom.conf file in the same directory as the other 3 conf files.  In it, put the following:

HTM_HEADER_BAR=my_header_bar.html
HTM_HEADER_WIDE=my_header_wide.html

Save, and ensure the files_custom.conf is world-readable (chmod 755).  Note: ensure the bottom of your files_custom.conf file has a newline character (press enter after the last line).  DA cannot read a line unless the end of the line has a newline character.

5) Now go into DA, and anyone who uses the Enhanced skin will now see your changes to the webmail button at the top of the page.

6) If the file you've changed is part of the enhanced skin, you may have missing |LANG_*| tokens.  To resolve that link to the other lang file, eg:

cd /usr/local/directadmin/data/skins/enhanced/lang/en
ln -s header_wide.html your_header_wide.html


 
Related Helpfiles
Creating a language pack for DirectAdmin
Adding your own custom banner/header image to the Enhanced skin

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST