rejetto forum
Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: nano28 on May 23, 2012, 10:36:33 PM
-
Hi, I am new in HFS template development.
Can I know whether is it possible to put incremental number automatically?
This is because I want to assign different ID to every filename.
In browser, I hope to get something like this:
<div id="1">Filename 1</div>;
<div id="2">Filename 2</div>;
<div id="3">Filename 3</div>;
... and so on depending on the number of file in the folder.
Thanks.
-
you can do this by using javascript OR by using HFS scripting available in version 2.3
http://www.rejetto.com/wiki/index.php?title=HFS:_Template_macros
{.for|x|1|9|{: <div id="{.^x.}">Filename {.^x.}</div>; :}.}
-
Hi...
Thanks for the reply.
I love to do this using javascript but still don't know how to make it work.
Is it possible to call function from javascript within HTML ID ?
Eg.
//JS code
var num=0;
counter(){
num++;
return num;
}
//HTML body
<div id=counter()>%item-name%</div>
-
it's explained at the link i gave you.
the meaning is: repeat with X from 1 to 9
-
Thanks for the answer.. it works. :D