Welcome to the LimeSurvey Community Forum

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

change file upload theme

  • zufolo441
  • zufolo441's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #215586 by zufolo441
change file upload theme was created by zufolo441
Hi, i need to edit theme of fileupload question. In detail, I need to add the link for file download.
in LS 2.6 I had do modify modaldialog.js file.
How can I obtain same result in LS 4.5.2+ by eventually editing question theme?

thanks.
The topic has been locked.
  • zufolo441
  • zufolo441's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #216153 by zufolo441
Replied by zufolo441 on topic change file upload theme
solved by editing a file. thanks.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 9 months ago #216158 by DenisChenu
Replied by DenisChenu on topic change file upload theme

solved by editing a file. thanks.
 
Did you have some information

It can be great for other user

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • zufolo441
  • zufolo441's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #216163 by zufolo441
Replied by zufolo441 on topic change file upload theme
I didn't have time to search for theming the question, so I edited the main file
application/views/survey/questions/answer/file_upload/answer.twig
and I edited rows from 122:
$(document).ready(function(){
{% set count = -1 %}
{% set surveyid = fileid|split("X")[0] %}
{% for item in value|split('"filename":"') %}
$('#a_{{fileid}}{{count}}').attr("href", "/upload/surveys/{{surveyid}}/files/{{item|split('"')[0]}}");
{% set count = count + 1 %}
{% endfor %}
});

</script>

<script type="text/x-template" id="filerowtemplate_{{fileid}}">
<tr>
<td class="upload {imageOrPlaceholder}">{imageOrPlaceholderHtml}</td>
<td class="upload title">{title}</td>
<td class="upload comment">{comment}</td>
<td class="upload edit"><a href="#" id="a_{{fileid}}{filepointer}" target="_blank" >{name}</a></td>
<td>
<a class="btn btn-primary trigger_edit_upload_{{fileid}}" data-file="{filepointer}">
<i class="fa fa-pencil"></i> &nbsp; {{ "Edit" | gT }}
</a>
</td>
</tr>
</script>
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 8 months ago #216196 by DenisChenu
Replied by DenisChenu on topic change file upload theme
Great !

I think you can update survey/questions/answer/file_upload/answer.twig in your Survey theme.

Maybe i take your code for skelvanilla

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • zufolo441
  • zufolo441's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #216224 by zufolo441
Replied by zufolo441 on topic change file upload theme
I couldn't find how to do. actually it's unclear for me how to add/edit a question theme.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months ago #216233 by tpartner
Replied by tpartner on topic change file upload theme
If you want a custom theme for all surveys using the survey theme, copy the /file_upload folder into /upload/themes/survey/yourTheme/views/survey/questions/answer/ and edit the files there.

Editing the core files leaves you exposed to overwriting when updating.[/i]

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 8 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose