dream genie
 
CMS and Website Builder
contact us
 
+44 (0)1392 202078
 
 
You are here: Home > Blog > How to specify an offset from your site root using [siteroot]   Go Back

How to specify an offset from your site root using [siteroot]

Posted: Sunday, 6th February, 2011 at 9:07 AM | By: Administrator
Feb
6
 

Important Technical note:

NOTE: All iinstances of the keyword [ siteroot ] in this article, will in practice require the removal of the single space to the left and right.


Sometimes you may not be sure of the relative path to a resource. For example using / simply means back a directory. Dreamgenie has a built in tag [ siteroot ] which will always resolve to an ofset from the site root

When you want to be sure of the correct path to your content or use [ siteroot ].

NOTE:
[ siteroot ] can be ued anywhere that a relative path is required, including crucially in your Additional HTML , Additional Javascript and Additional CSS blocks.

The path to your uploads directory is

[ siteroot ]_images/uploads 

NOTE: Remove the single space to the left and right of the keyword siteroot above.

Example a:

You have uploaded the file myfile.doc using the file manager in dreamgenie back-office to the directory [docs] under your uploads directory. To speicy a link to this document using siteroot we would use the form

<href="[ siteroot ]_images/uploads/docs/myfile.doc" alt="download myfile.doc">Download myfile.doc</a>



Example b:

You are building a tab control and want to include the resources dgtabs.js and dgtabs.css. The code for including these files will need to be placed into your Additional Javascript section of your webpage, or article template.



<link rel="stylesheet"type="text/css"href="[ siteroot ]_style/dgtabs.css?v=0"/>
<script src="[ siteroot ]_javascript/dgtabs.js"type="text/javascript"></script>

 


Visit the blog archive »

You are welcome to post a comment


To Verify You are Human!
Please enter the code above:

Previous Comments

None