Which .twig can be loaded in QuestionThemes

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.

<!-- Those metadata will be displayed in the template configuration page. They are not used for now. -->
<title>Bootstrap Buttons</title>
<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>
<description>New implementation of the Bootstrap buttons question theme</description>

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)

<category>Display theme options</category>
<xs>Extra small</xs>
<help>Change button size</help>
<caption>Button size</caption>
<category>Display theme options</category>
<help>Choose maximum number of buttons in a row</help>
<caption>Maximum number of buttons in a row</caption>
<!-- hidden attributes -->
<help>hide display_columns</help>
<caption>hide display_columns</caption>
<help>hide input_size</help>
<caption>hide input_size</caption>

<!-- Here datas about how LimeSurvey should load the core js/css of the question -->

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
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 .

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