Design and CSS styles
Version 2.x > Design and CSS styles > images, scripts, and other resources View modes: 
User avatar
Member
Member
kelly@sumrall.us - 7/5/2007 9:56:31 PM
   
images, scripts, and other resources
how are resources handled? I have some javascript code that is managing image rollovers. Is there an easy way to deal with the src attribute of img and script tags? If I upload these resources, they appear to get their own guid identifier. This makes it very difficult to write client side script. The only place I can think to include these files is in the App_Themes/Project folder. Is there any other location more appropriate to put scripts and images so they can be referenced directly?

User avatar
Member
Member
kentico_petrpa - 7/11/2007 10:17:50 AM
   
RE:images, scripts, and other resources
If you check to Store Files In File System in the SiteManager -> Settings -> Files, then your uploaded images wil be stroed in the File system, so you can reference them normally as you are used(just use the path to the file in file system - no need to use the guid). Other option is to use the aspx suffix with your images - if you upload "image.gif" you can reference it as a "image.aspx" in your scripts.

User avatar
Member
Member
Mufasa - 1/23/2008 11:46:37 PM
   
RE:images, scripts, and other resources
For general assets, like graphics for Web Part Containers for example, I use the App_Themes area too. You just have to either hard-code the theme name or get it dynamically, if you can (depending on what source is requesting the media: aspx, css, js, etc.).

Also, keep in mind that although the FCK Editor will use URI's with the full GUID, those assets still have an Alias Path that can be used. Go to the asset in the CMS Desk and then the Properties tab. It is listed there. FYI, personally, I usually modify the URI to be "~/Files/imagefilename" instead of "/Files/imagefilename.aspx". (Note: You have to do the process describing in the Install manual to use URIs like that though.)