rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: Moerten on March 10, 2007, 04:21:30 PM

Title: template folder question
Post by: Moerten on March 10, 2007, 04:21:30 PM
Hi,

I`m working on my template. But my question is: if i use %folder% and i see in from web it says: /someting/otherthing, what i want my %folder% without the first "/" how can i do that?

Thanks,
Title: Re: template folder question
Post by: Giant Eagle on March 11, 2007, 03:46:37 PM
Hi,

I`m working on my template. But my question is: if i use %folder% and i see in from web it says: /someting/otherthing, what i want my %folder% without the first "/" how can i do that?

Thanks,

In your example, %folder% would show /something/otherthing/.

If you want to get rid of both the first and the last slash, use the following code instead of %folder%:

Code: [Select]
<script type="text/javascript">
document.write("%folder%".slice(1, -1));
</script>

Or if you just want to get rid of the first slash, simply use this one:
Code: [Select]
<script type="text/javascript">
document.write("%folder%".slice(1));
</script>