rejetto forum

%symbols% and macros in index

r][m · 8 · 3699

0 Members and 1 Guest are viewing this topic.

Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
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?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
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?
« Last Edit: October 24, 2010, 03:31:48 PM by r][m »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
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.



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
@ 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?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
macros in external files "disabled" for security reasons.
you can circumvent this by passing through a variable
{.load|/Pages/page1.html|var=x.}{.^x.}