Jump to content

Graphic Resource in Links folder?


Recommended Posts

Watched the video on how to get the data file to pull resources. The demo only covered the instance of having these resources in the same directory. I would like to put my resources in a subdirectory. The demo said this could be done by adding the file path to the script, but when I do this it seems to change the result to "text" and I get the error "This graphic rule must return a resource type graphic". Here is my current rule:


return '/Users/george/Desktop/Testing/Links/' + CreateResource(Field("Photo") , 'graphic' , 1);


What do I need to do here? :confused:

Link to comment
Share on other sites

The path needs to be inside the CreateResource function. Though you should be able to use a path relative to your template file. Assuming it's located in the "Testing" folder, you could use this code:


CreateResource("./Links/" + Field("Photo"), 'graphic', 1);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...