rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: awilson84 on October 13, 2016, 08:20:01 PM

Title: New HFS user- simple question regarding CSS/Template files
Post by: awilson84 on October 13, 2016, 08:20:01 PM
Hi everyone, my co-worker recently introduced me to this software and your forum. I had been searching for a good solution for my side business, basically to just host a file server that my technicians could access from anywhere and download particular files we use for clients and stuff like that.

After doing some reading over the past few days I was able to successfully setup my server and serve my files out properly HOWEVER, I am very confused on if/how there are any restrictions on these templates? When I choose the option to "edit HTML template" it only gives me a CSS and a TPL file to make changes. IS there an "index.html" file? The reason I ask, is because when I try to add any java script or 'div' tags to float images or make changes in the CSS it doesn't appear in the 'source code' once the files are saved. How can I edit the actual HTML itself? or does something extra have to be added to the CSS?

The different templates I've been playing around with are the rawr blue, black, and diehard. All of them are of course designed differently but again, I can't seem to understand how to get full control over changing them. From the reading I've done here on this forum it looks like the "template editor" is not around anymore, so what exactly do HFS users do when they want to add in their own code?

Just ONE good example of what's going on is that currently I'm trying to "float" an image within one of the templates and while I have no other choice but to input the code into the CSS file, when I view the source code of the page it doesn't show the same code as what's been input inside my CSS. I hope this makes sense to someone here, thanks in advance!

PS: When I get paid tomorrow I plan on making a donation or two to this site over the next month. This software is almost invaluable, I've been overflowing with ideas on different ways it could be implemented and used. I also want to start sharing out and submitting new templates that I made myself once I figure out exactly how HFS is handling the web-interface part of all this. Aside from that, I just want to say that the myriad of options, user account permissions, and networking/security features this software has is nothing short of f*ckin' impressive!!  8)


Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: bmartino1 on October 14, 2016, 03:02:55 AM
my understanding of the program, that if you have an index.html file at the root(the house), that file will become the main page and auto redirect.

if not, right click properties the house, "different template tab" if you put you index.html file there, the whole server will be that page. the edit tpl can be place in a folder that would then require the hfs features for upload and download.

Mars, is better at explain this stuff then I am,
Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: LeoNeeson 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.-
Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: Mars on October 14, 2016, 12:48:03 PM
HFS is software that allows  data to be displayed in a browser, it is based on a language mimicking PHP and based on a template.

if in a real folder, there is a HTML file named "index" or "default", it replaces the template.

To use HTML file at the root of VFS, you have to bind ROOT to real folder linked to a directory on disk, in which the html file will be placed.

we must also remember that hfs never interpret a macro contained in a pure HTML file
Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: awilson84 on October 18, 2016, 08:23:13 PM
Thank you all for the information! From the testing I've done over the past few days this is where I'm stuck. When trying to use certain Javascript inside the template file it seems to be selective or possibly even restricted from particular things.

As mentioned previously I've been doing as much reading on this forum as possible to see if any past efforts were of any help, added with the info provided by you gentlemen. 

Essentially what you were saying is that if I want to keep things very simple and not add any extra pages to the server I just need to alter the ".tpl" file? It appears as though I'm not the only user who has asked similar questions, thankfully I found at least one fairly recent thread that allowed me to do some troubleshooting.

Specifically "bmartino1" instructing another poster on adding the Javascript in for a Paypal icon. While I've had plenty of experience pasting their code into other websites I decided to give it a try on my HFS server even though I won't be using it, just to test out and see if the code would show up in the "view source" option. What I found is that when I paste that particular code into my ".tpl" file it works just as it should and it also does show up in the view source code.  Now I'm just a little confused on why that works fine, but yet if I test with any other Javascript, or even simply using div tags and floating images around, then that code does not show up in the source hence leading me to believe that it's either being put in the wrong place, or additional code needs to be added or removed.

Another helpful resource from that thread was reading about pasting in Javascript code for ad publishing; which again like the Paypal icon button I do not need it. BUT the useful tool I remembered from my past experiences with ad publishing sites they use a "troubleshooter" option to test that your code has been placed in the correct spot within your website. I tried this with 2 separate ad sites and not only could they not detect the code, but just like my previous Javascript entries into the template file they still didn't show within the "view source" option.

At this point I just don't understand how the Paypal code can be pasted into my template file, shows up on the website, and in the source code; but yet these other things won't show in the source?? The only thing this leads me to conclude is that there must be some alternative way, or extra bit of something that needs to be added to the Javascript in order to make it show up in the source (and function properly of course  :P)

Is it pretty common for HFS users to make an "index.html" for their sites? If this is what I'll need to do in order to get the designs I want, and start creating templates to share then I suppose I would just need the best step-by-step guide in doing that because the threads I've read here on that topic aren't very clear to me unless I missed one.   ???

Of course I would prefer to figure out exactly why the different scripts inside my code inside my code aren't working or showing up in
Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: bmartino1 on October 19, 2016, 03:04:16 AM
that because most of the template code is directed at the HFS problem on how to handle things, while the papal HTML is web code and is directed at the client.

hfs receives the client template code and reacts varying on the code itself. that the nature of http.

hfs scripting comands
http://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands

html basics:
http://www.w3schools.com/html/html_basic.asp

more info:
https://en.wikipedia.org/wiki/HTML
https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
Title: Re: New HFS user- simple question regarding CSS/Template files
Post by: rejetto on November 13, 2016, 06:31:40 PM
hi! sorry for the late reply.
If it's not showing in the source code in the browser, then you pasted it in the wrong place.
The template has different sections, and you have to understand the sections, OR you can look at the source code in the browser (around where you want it) and then search for the same text in the template.

You should also consider reading the documentation explaining that, if you didn't yet
http://www.rejetto.com/wiki/index.php?title=HFS:_Template