Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Survey Copy - Pictures Do Not Show

  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
5 years 4 months ago - 5 years 4 months ago #178031 by LouisGac
Replied by LouisGac on topic Survey Copy - Pictures Do Not Show

domsson wrote: For anyone else who stumbles upon the problem of referencing pictures in a more portable way, I found a nice solution. Note, however, that I'm working with LimeSurvey 3, not sure if it also works in 2. Anyway, here goes: instead of hardcoding the survey ID, use the placeholder {SID}. So to stick with the OP's example:

Instead of this:

Code:
<img src="/360survey/upload/surveys/643182/images/OIHHGN0.jpg">

Do this:
Code:
<img src="/360survey/upload/surveys/{SID}/images/OIHHGN0.jpg">

Now, if you move/migrate the survey and it's ID changes, all should be well! Hope this will help someone.


great solution.

Also, in LS3, I recently added a way to use a single upload directory for all surveys:
github.com/LimeSurvey/LimeSurvey/blob/ma...ig-defaults.php#L557

So in config.php you can set:

'uniq_upload_dir' => true
Last edit: 5 years 4 months ago by LouisGac.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose