rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: r][m on October 23, 2010, 05:32:10 AM

Title: %symbols% and macros in index
Post by: r][m on October 23, 2010, 05:32:10 AM
In my test version of HFS I have an "Index.html" cover page which is default file
mask for root.
This is in a real folder and root is bound to it. This folder is in the VFS.

My question is.... why doesn't  %ip% and macros work on this page?
Title: Re: %symbols% and macros in index
Post by: Mars on October 23, 2010, 04:42:47 PM
Files .html are passed on such which by hfs without analysis of the contents, it is necessary to rename the index.html by hfs.diff.tpl, because only this last one is considered as a template

 ;D :D
Title: Re: %symbols% and macros in index
Post by: r][m on October 23, 2010, 06:49:17 PM
Ok, I copied the page content to Different template in Properties for root,
removed default file mask and unbound root.
Now the page is served, %ip% works, but now this page is all that can be accessed.
Now this page is file mask for all subfolders, and no link I've tried on this page will
access the file server. Even redirect on login fails.

Anyone know of a way around this?
Title: Re: %symbols% and macros in index
Post by: Mars on October 24, 2010, 05:07:06 PM
if you put your index.html as diff template on root, the hfs template is not served for all subfolder, i don't understand what you will to do, but it seems that you are turning in round   ;D
Title: Re: %symbols% and macros in index
Post by: r][m on October 24, 2010, 11:01:25 PM
Perhaps I didn't explain properly.
I want a index.html page as a home page, that shows users ip, and can perhaps run a macro.
This is the first thing a user sees when they come to hhtp://myaddress.com/.
This page is not protected, but has a link to log in to the server.

When this page is diff tpl, you get the login, but cannot get past this page.
You are returned to it no matter what address you put in the browser. This page
is inherited and served as default file mask for all sub folders of root here.

If you have a solution I'd like to see it.

Title: Re: %symbols% and macros in index
Post by: rejetto on November 01, 2010, 11:40:15 AM
sorry for the late reply.
try this diff tpl (i didn't test)

[]
{.if|{.%url% != /.}|{:
  {.comment| this is not the root, so we are loading the original main section then stop .}
  {.section||back=1.}
  {.break.}
:}.}
here goes your page content
Title: Re: %symbols% and macros in index
Post by: r][m on November 02, 2010, 04:13:17 PM
@ Rejetto
Thanks
[]
{.if|{.%url% != /.}|{:
  {.comment| this is not the root, so we are loading the original main section then stop .}
  {.section||back=1.}
  {.break.}
:}.}
{.load|/Pages/page1.html.}
The load macro stopped page1 from appearing on all server pages.
Now the index page log in link and %ip% works,
however macros like {.$section.} in the index page don't.
Expected?
Title: Re: %symbols% and macros in index
Post by: rejetto on November 08, 2010, 10:32:17 PM
macros in external files "disabled" for security reasons.
you can circumvent this by passing through a variable
{.load|/Pages/page1.html|var=x.}{.^x.}