Which .twig can be loaded in QuestionThemes

Mehr
5 Monate 14 Stunden her - 5 Monate 14 Stunden her #190844 von mrleugim33
Hello everyone,
Im implementing my own question theme in which I want to put the "question_text_content.twig" and the custom .js and .css.
The problem that I'm facing is that even though the .css loads correctly, the .js doesn't appear when previewing the question and the html from the "question_text_content.twig" is not loaded. I have the same tree structure as in the Bootstrap button Question theme (I based mine over it)
├── bootstrap_buttons
│   └── survey
│       └── questions
│           └── answer
│               └── shortfreetext
│                   ├── answer.twig
│                   ├── assets
│                   │   ├── bootstrap_buttons_listradio.png
│                   │   └── scripts
│                   │       ├── bootstrapbuttons.css
│                   │       └── bootstrapbuttons.js
│                   ├── columns
│                   │   ├── column_footer.twig
│                   │   └── column_header.twig
│                   ├── config.xml
│                   ├── question_text_content.twig
│                   └── rows
│                       ├── answer_row_noanswer.twig
│                       ├── answer_row_other.twig
│                       └── answer_row.twig

And the config file is as follows:


<?xml version="1.0" encoding="UTF-8"?>
<!--
Default configuration for the listradio question template.
-->

<config>
<!-- Those metadata will be displayed in the template configuration page. They are not used for now. -->
<metadata>
<name>bootstrap_buttons</name>
<title>Bootstrap Buttons</title>
<creationDate>22/05/2018</creationDate>
<author>Dominik Vitt</author>
<authorEmail>Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!</authorEmail>
<authorUrl> www.limesurvey.org </authorUrl>
<copyright>Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<version>1.0</version>
<apiVersion>1</apiVersion>
<description>New implementation of the Bootstrap buttons question theme</description>
</metadata>

<!--
Here the list of the css/js files to load.
Any file here will be loaded via the asset manager (when in config.php debug = 0)
-->
<files>
<css>
<filename>scripts/bootstrapbuttons.css</filename>
</css>
<js>
<filename>scripts/bootstrapbuttons.js</filename>
</js>
<preview>
<filename>bootstrap_buttons_listradio.png</filename>
</preview>
</files>

<custom_attributes>
<attribute>
<name>button_size</name>
<category>Display theme options</category>
<sortorder>90</sortorder>
<inputtype>buttongroup</inputtype>
<options>
<default>Default</default>
<lg>Large</lg>
<sm>Small</sm>
<xs>Extra small</xs>
</options>
<default>default</default>
<help>Change button size</help>
<caption>Button size</caption>
<i18n>hr</i18n>
</attribute>
<attribute>
<name>max_buttons_row</name>
<category>Display theme options</category>
<sortorder>91</sortorder>
<inputtype>buttongroup</inputtype>
<options>
<default>Default</default>
<col-sm-12>1</col-sm-12>
<col-sm-6>2</col-sm-6>
<col-sm-4>3</col-sm-4>
<col-sm-3>4</col-sm-3>
<col-sm-2>6</col-sm-2>
<col-sm-1>12</col-sm-1>
</options>
<default></default>
<help>Choose maximum number of buttons in a row</help>
<caption>Maximum number of buttons in a row</caption>
</attribute>
<!-- hidden attributes -->
<attribute>
<name>display_columns</name>
<inputtype></inputtype>
<help>hide display_columns</help>
<caption>hide display_columns</caption>
</attribute>
<attribute>
<name>input_size</name>
<inputtype></inputtype>
<help>hide input_size</help>
<caption>hide input_size</caption>
</attribute>
</custom_attributes>

<!-- Here datas about how LimeSurvey should load the core js/css of the question -->
<engine>
<load_core_css>true</load_core_css>
<load_core_js>true</load_core_js>
<show_as_template>true</show_as_template>
<show_as_question_type>true</show_as_question_type>
</engine>
</config>


Is there any problem in the config or the folder structure that I'm missing??

(If it helps, I've checked that the temporary files are correct, but they are not, even after deleting them they still have the original code).

Thank you very much for any help ^^
Letzte Änderung: 5 Monate 14 Stunden her von mrleugim33.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
5 Monate 12 Stunden her #190854 von tpartner
I'm not sure why the JS is not loaded but you will need to reference the custom Twig file from within an existing Twig file.

{% include './survey/questions/answer/shortfreetext/question_text_content.twig' %}

Have a look at the structure and manifest of this custom theme which loads a CSS file, a JS file and a custom Twig file - github.com/tpartner/LimeSurvey-Multiple-Choice-Dropdown .

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha