Jump to content

Graphic Resource in Links folder?


ThePorge

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...