__CONTENTS_ROOT__¶
__CONTENTS_ROOT__ is a constant that contains path to the public content available in project. This is a root path where all mobile website images, CSS and JavaScript files are located.
__CONTENTS_ROOT__ is represented as in the File Manager breadcrumbs. The content under __CONTENTS_ROOT__ is available for editing in File Manager.
__CONTENTS_ROOT__ can be used in template code to specify different resources like images, CSS, JavaScript files, etc.
When Flamingo is initialized on a page, this constant gets its value using the dataUrl() method:
__CONTENTS_ROOT__ = Flamingo.dataUrl();
Example 1¶
You can use the following code in your template to link newly uploaded CSS file to a page using __CONTENTS_ROOT__:
<link rel="stylesheet" type="text/css" href="/css/styles.css" />
You can add default code for linking CSS or JavaScript file automatically by clicking the or button on the Code Editor Toolbar correspondingly, and customize this code according to the file you are linking.
Example 2¶
You can use the following code in your template to display uploaded image on a page using __CONTENTS_ROOT__:
<img src="/images/mypicture.png" alt="my picture" />
You can insert default code for adding image automatically by clicking the button on the Code Editor Toolbar, and customize this code according to the image you are adding.
See also