rejetto forum
Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: rscataran on April 22, 2016, 05:12:29 AM
-
Good day,
I am very thankful for this great software.
Searching the forum if possible to change the template when the user logged in.
Currently investigating the hfs.events and load.tpl but I did not see the event that I needed.
The scenario I was hoping for would be like this:
-Upon opening HFS (anonymous), Template is Live 3.0.1
-Once logged in set the default template.
Cheers!
-
it is, but it a bit trikey and has (as far as my knowledge) be done with redirects.
you would essentaily be hosting the same fodler twice adn the different tempate would be thte tempalte fo that folder.
whan the user logins, they would become redirected to the tempate, and teh links there can be edited.
Its messy and not a great way to do it, but it is possible...
-
it should be possible with {.load tpl.}
since you want Live to be your base template, i would install it, but first i would save the default template to a file, so it can be loaded by the command above.
the event could be just [request]
and you should check %user% to know if people are logged in
like
[+request]
{.if|%user%|{: {.load tpl|myfile.tpl.} :}.}
in events.
I didn't try it, anyway.
-
I did the [+request] instructions and it loads the default template as expected. But I think there is a slight difference on the page.
Here is a screenshot..
It seems the two column layout was gone.
Update:
Upon further checking, I also found out that some of the button on the Actions section was missing.
-
This is the work around I did.
I set the default template in HFS.
then on the events I added
[+request]
{.load tpl|themes/Live-3.0.1.tpl.}
[+request]
{.if|%user%|{: {.load tpl|hfs.tpl.} :}.}
It seems that the default template needs to load first before using it in {.load tpl.} to get the correct effect.
-
it's not necessary to use events
you can use the hfs.tpl as principal template
after the line contenting section [], insert only those two lines
[]
{.load tpl|themes/Live-3.0.1.tpl.}
[loggedin]
-
I tried what you suggested. I also thought that it would work.
But opening the page for the first time shows a blank white paget. Then, when I hit the refresh button, that's when the Live template will load correctly.
Any idea what's happening? I check the page source and its blank.
-
Add your "themes" directory as a real subfolder into root of VFS, then change the properties to hidden recursively
I remember the rejetto solution that works properly with Internet Explorer, and firefox 49.0.2
because you want the default template once the user is logged and the template LIve otherwise, here's how to do this
[+request]
{.if not|%user%|{: {.load tpl|themes/live.tpl.} :}.}