function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anthony PicaAnthony Pica 

Conditionally link to assets

Hi,

 

If the parent page element is selected then the Scripts and Style Sheets menus appear in the Properties tab on the right. In the Script menu we can add scripts to both <head> and <body>. Additionally, we can configure the content of <head>. This is how I am including some <meta> content and a <!--[if IE]> statement. My question is how do I conditionally link to assets?

 

For example, below is the code from our original site with the original relative paths. How do I link to selectivizr-min.js without hosting the file myself? This file is already imported, I just need to know the location of it in Siteforce so I can link to it.

 

<!--[if IE]>
<script type="text/javascript" src="media/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="media/js/selectivizr-min.js"></script>
<script type="text/javascript" src="media/js/jquery.placeholder.js"></script>
<script>$(document).ready(function() { $(document).placeholder(); });</script>
<link type="text/css" rel="stylesheet" href="media/css/ie.css" /> 
<![endif]-->
		
<!--[if lte IE 6]>
<link type="text/css" rel="stylesheet" href="media/css/ie6.css" /> 
<![endif]-->

 

Thanks in advance,

Anthony

JuanluJuanlu

Hi Anthony,

 

As far as I know, you can add all js and css files as Assets but you can't create folders. In other words, you can't have a tree structure for Assets.

 

Try to link the files directly to the "root" folder:

<!--[if IE]>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="selectivizr-min.js"></script>
<script type="text/javascript" src="jquery.placeholder.js"></script>
<script>$(document).ready(function() { $(document).placeholder(); });</script>
<link type="text/css" rel="stylesheet" href="ie.css" /> 
<![endif]-->
		
<!--[if lte IE 6]>
<link type="text/css" rel="stylesheet" href="ie6.css" /> 
<![endif]-->



Bear in mind the current css files issues in Siteforce:

http://boards.developerforce.com/t5/Siteforce/Siteforce-doesn-t-support-the-CSS-property-quot-content-quot/td-p/339583

 

Kind regards,

Juanlu.