Custom Question Views not working

More
1 year 5 days ago #145622 by rleuthold
rleuthold created the topic: Custom Question Views not working
Hi I have followed the instructions here to activate custom question views. Unfortunately it is not working:
  1. Set <overwrite_question_views>true</overwrite_question_views> in config.xml of my own template
  2. Set 'allow_templates_to_overwrite_views' => 1 in application/config/config.php
  3. Also tried to set 'allow_templates_to_overwrite_views' => 1 in application/config/config_defaults.php
  4. Copied application/views/survey directory to upload/template/my-template/views/

Did I miss anything?

I'm running Version 2.56.1+161118

Please Log in to join the conversation.

More
1 year 5 days ago #145639 by LouisGac
LouisGac replied the topic: Custom Question Views not working
most probably a wrong path
The following user(s) said Thank You: rleuthold

Please Log in to join the conversation.

More
1 year 4 days ago - 1 year 4 days ago #145653 by rleuthold
rleuthold replied the topic: Custom Question Views not working
Thanks for the reply - and which path could be possibly wrong? Any specific idea what to check?

I attached a screenshot showing the directory tree of my template.
Attachments:
Last Edit: 1 year 4 days ago by rleuthold.

Please Log in to join the conversation.

More
1 year 4 days ago #145654 by LouisGac
LouisGac replied the topic: Custom Question Views not working
how do you know it's not working? make a test with a very visible input.

Please Log in to join the conversation.

More
1 year 4 days ago #145658 by rleuthold
rleuthold replied the topic: Custom Question Views not working
That is simple - if I change upload/template/my-template/views/survey/frontpage/enterToken.php (e.g. delete the jumbotron section), no change is visible. If I do the same in application/views/survey/frontpage/enterToken.php, the change is visible. Therefore I know that my custom view is not picked up.

Please Log in to join the conversation.

More
1 year 4 days ago - 1 year 4 days ago #145659 by LouisGac
LouisGac replied the topic: Custom Question Views not working
also:

rleuthold wrote:

  • Also tried to set 'allow_templates_to_overwrite_views' => 1 in application/config/config_defaults.php

  • Never change config_defaults, but config.php:
        'config'=>array
        (
            // debug: Set this to 1 if you are looking for errors. If you still get no errors after enabling this
            // then please check your error-logs - either in your hosting provider admin panel or in some /logs directory
            // on your webspace.
            // LimeSurvey developers: Set this to 2 to additionally display STRICT PHP error messages and get full access to standard templates
            'debug'=>0,
            'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2
            'allow_templates_to_overwrite_views'=>1,
        )
    Last Edit: 1 year 4 days ago by LouisGac.

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145660 by LouisGac
    LouisGac replied the topic: Custom Question Views not working

    rleuthold wrote: That is simple - if I change upload/template/my-template/views/survey/frontpage/enterToken.php (e.g. delete the jumbotron section), no change is visible. If I do the same in application/views/survey/frontpage/enterToken.php, the change is visible. Therefore I know that my custom view is not picked up.


    Enter token is not a question view, I think you can't override it for now. I can add it if you want, so it will be possible in next release.

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145662 by LouisGac
    LouisGac replied the topic: Custom Question Views not working
    Ok done:
    github.com/LimeSurvey/LimeSurvey/commit/...256c8a565de36cf54819

    It will be available in next release. If you can't wait, just copy paste the file application/helpers/frontend_helper.php from the repository to your installation:
    github.com/LimeSurvey/LimeSurvey/blob/ma.../frontend_helper.php

    (be sure you're running the last version first)

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145664 by rleuthold
    rleuthold replied the topic: Custom Question Views not working
    Ah I see - makes sense :-) Would be great to have that possibility in the next release. Thank's for your help and answers.

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145665 by LouisGac
    LouisGac replied the topic: Custom Question Views not working
    have a look to my last post, I just did it.

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145666 by rleuthold
    rleuthold replied the topic: Custom Question Views not working
    Quick & perfect - works now. Thank you very much!

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145675 by rleuthold
    rleuthold replied the topic: Custom Question Views not working
    Hey LouisGac - sorry a bit off topic but I din't know how to contact you otherwise. I noticed an error since the last commit: Cannot redeclare doRender(). Seems logic, since we have the method in frontend_helper.php (last commit) and qanda_helper.php.

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145679 by LouisGac
    LouisGac replied the topic: Custom Question Views not working
    ok let me me fix that

    Please Log in to join the conversation.

    More
    1 year 4 days ago #145680 by LouisGac
    LouisGac replied the topic: Custom Question Views not working
    ok done, just update frontend helper.

    Please Log in to join the conversation.

    Start now!

    Just create your account and start using Limesurvey today.

    Register now
    Join our Newsletter!