Author Topic: New HFS user- simple question regarding CSS/Template files  (Read 3810 times)

Offline LeoNeeson

  • Tireless poster
  • ****
  • Posts: 573
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: New HFS user- simple question regarding CSS/Template files
« on: October 14, 2016, 05:48:29 AM »
Hi, and welcome! :D I'm glad to have you here, we need more 'enthusiasts' who promote and help HFS to grow. Anyone can collaborate here.

About your question, the 'index.html' you are looking for, is in fact dynamically generated from a Template file (and is not needed to have a real 'index.html' file). In fact, if you have an 'index.html' on your shared folder, it will be interpreted by HFS as an 'statical' file, something you really don't need (unless your are using HFS to host a static website). But for having a website about sharing files, you need to edit the default TPL file (Template file), which has the filename "hfs.tpl".

Where is this "hfs.tpl" located? This file is initially 'bundled' inside the main HFS executable, and when you make changes on the default template (hfs.tpl), your modified template file it's being saved in your HFS folder, along with your HFS.exe. In case you want to switch back (or undo) all your changes (and go back to the default template), you simply need to delete that "hfs.tpl" file, and HFS will use his 'internal' default copy. This is how HFS works.

Well, now you may be wondering how to edit that "hfs.tpl" file? It's easy...

1) Being inside HFS, press F6 to open the default template file. This action, will make a copy of "hfs.tpl" on your main HFS folder, and will automatically open this file with your default text editor (generally, with Notepad).

2) Inside this "hfs.tpl" file, you will find every piece of HTML code needed by HFS to work. For example, you will find here the error page, the upload results, the unauthorized page, etc, etc...

3) To start, you may want to search for this string (marked in bold):
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">"
And there you will find the HTML code used by HFS to dynamically display the page. I guess you understand how to edit HTML code, so the only recommendation is to carefully edit only the parts you need. And in case of problems, simply delete the "hfs.tpl" file and start all over again. When you change some code, remember to save the file to apply the changes.

Feel free to ask anything you want. I don't know much more than this, but for now this will help you to start.

Happy testings! ;D
Leo.-
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
• I'm open to help and share any file you may need (just ask me) ;)

Follow members gave a thank to your post: