rejetto forum
February 12, 2012, 10:52:19 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: %style% problems in custom template  (Read 1283 times)
0 Members and 1 Guest are viewing this topic.
Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« on: November 09, 2008, 01:12:42 PM »

Hello everybody

First I'd like to thank everybody involved with HFS.

I am trying to make my own template for my tiny space on the web. I'm using HFS 2.3 212.

I have 3 sections on my web, 1 general, 1 for software and 1 for media. I want each one to have a different look, eg. section 1 blue, section 2 red and section 3 green, with links and some text changing color as well. I did protect the root of my site with an admin password. My problem is that each time I log in the web some text is not changing color as expected. The %loggedin% var keeps blue in all sections.

Also, I noticed the %style% var in the template isn't working. When I take a look at the source code of the page in my browser, everything looks ok, but there aren't any %style% vars. Just an empty line. I have to insert styles inside both main and [error-page] sections.

I'll attach my templates for anybody kind enough to help me out with those issues.

* Templates.zip (9.08 KB - downloaded 122 times.)
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #1 on: November 10, 2008, 08:29:33 AM »

welcome Wink

instead of having 3 full templates, have only one.
where things change, like the background
Quote
  body {font-family: Verdana, Arial, Tahoma, sans; font-size: 1em; font-weight: normal; background-repeat: no-repeat; background-color: #140000; color: #9B9B9B; margin: 1em }

you put a macro

background-color: {.$my background color.}


I guess your 3 "sections" are actually folders.
Then you put as diff template (in folder properties, or as external files, as you prefer)

[my background color]
#140000


Of course  you will put different values for different folders.
Logged
Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« Reply #2 on: November 10, 2008, 09:21:22 AM »

Thanx for your help Rejetto, I always wondered what were these weird {.$whatever.}  Cheesy

I'll give it a try once I finish cleaning my template up... I never thaught it could take so much time...

Oh another thing I've been battling with for days:

I did put go up and go down links, and I want them to diappear when there are not many files in a folder. I'm using this java script but it works rather erratically:

</script><script type="text/javascript">
<!--
  if ("%number-folders%"+"%number-files%"+"%number%" > "10") {
  document.getElementById('gotobottom').innerHTML = "";
  document.getElementById('gototop').innerHTML = "";
}
//-->
</script>

I tried some combinations with vars, some working better than others, but still no cigar. Any way I can do that on any folder?
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1469



View Profile WWW
« Reply #3 on: November 10, 2008, 09:29:53 AM »

I remeber that %number% = %number-folders% + %number-files% + %number-links% Cheesy


your " if ("%number-folders%"+"%number-files%"+"%number%" > "10") {...."  is fake. Angry

uses this for the syntax
Quote
...
</script>

<script type="text/javascript">
<!--
  if (eval(%number-folders%+%number-files%+%number-links% > 10)) {
  document.getElementById('gotobottom').innerHTML = "";
  document.getElementById('gototop').innerHTML = "";
}
//-->
</script>

and more short
Quote
...
</script>

<script type="text/javascript">
<!--
  if (%number%> 10)) {
  document.getElementById('gotobottom').innerHTML = "";
  document.getElementById('gototop').innerHTML = "";
}
//-->
</script>
« Last Edit: November 10, 2008, 09:41:31 AM by mars » Logged
Grinderedge
Occasional poster
*
Offline Offline

Spain Spain

Posts: 6


View Profile Email
« Reply #4 on: November 11, 2008, 09:58:22 AM »

Hello again

Once again I exhausted all my resources on trying to do simple stuff. I'm turning to you guys for your help once again...

What I'd like to do:

- have a web page on top of HFS (2.3 214) with a bunch or folders (real ones, root is not bound to a folder).
- have a custom template for root (first page to show when somebody enters the web), another one for a folder called Software and a third one for a folder called Media.

4 things change between those templates: background color, font color, colors for %vars% (like %loggin-link% and %loggedin%), and a banner on top of the web.

Results so far:

- When I write down the templates in the Diff template tab for each folders I want to customize, the banner changes when I change folder but colors don't.

- When I put a hfs.diff.tpl file in each of the real folders I get the same result as above.

- When I use macros colors change alright, but the banner doesn't change at all. It always shows the banner for root.

- When I don't give any of the 4 parameters (e.g. leave them blank) I want to change to the hfs.diff.tpl or the diff template for root, everything works just fine, but of course the first page to show in browser has no colors/banner...

Questions:

- Is there something special about root that makes it impossible to change with diff template or hfs.diff.tpl?

- Why do macros work for backgrounds/color but not for an image?

- I would like to get back to root when I click on the banner. I did read something about macros not working with links http://www.rejetto.com/forum/index.php?topic=5631.0. Has this any impact on what I'm trying to do or I am on the wrong track?

- Is there any workaround for this? Maybe an index.html doc? If so, how can I link the Index doc to the rest of my page?

Sorry for my rather long post and verbosity and thanx for your help with this. Attached is my template if anybody cares to spend time looking into this matter.

* Main Template.tpl (11.89 KB - downloaded 122 times.)
* Diff Templates & VFS Structure.txt (0.69 KB - downloaded 113 times.)
« Last Edit: November 11, 2008, 09:15:16 PM by Grinderedge, Reason: Make post shorter, cleaner and more precise » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page January 06, 2012, 06:06:57 AM
anything