Price
Occasional Observer

Referencing a folder

Jump to solution

Hi There, 

I am really hoping someone can help me out here since I am hitting my head against my desk..

I am attempting to reference to a folder within a Javascript, so it will show the path to the said folder.

skinPath: '$CMS_REF(media:"myfolder")$',

This is unfortunately coming up when I check the preview to being empty..

skinPath: '',

When the result I require is

skinPath: 'myfolder',

I have obviously attempted to it with $CMS_VALUE, but get just a huge array of errors.

Does anyone out there know how I can do this?

All help is much appreciated..

0 Kudos
1 Solution

Accepted Solutions
hoebbel
Crownpeak employee

Dear Price,

it isn't possible to reference a [media-]folder directly. But instead you can reference a media within the folder and appropriate shorten the URL, e.g. $CMS_VALUE(ref(media:"myMedia").url.substring(0,ref(media:"myMedia").url.lastIndexOf("/")))$

Best regards
Holger

View solution in original post

1 Reply
hoebbel
Crownpeak employee

Dear Price,

it isn't possible to reference a [media-]folder directly. But instead you can reference a media within the folder and appropriate shorten the URL, e.g. $CMS_VALUE(ref(media:"myMedia").url.substring(0,ref(media:"myMedia").url.lastIndexOf("/")))$

Best regards
Holger