Welcome to the LimeSurvey Community Forum

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

Plugin event for token screen

  • gdinunzio
  • gdinunzio's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #269784 by gdinunzio
Plugin event for token screen was created by gdinunzio
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen] 5.6.68
Own server or LimeSurvey hosting:
Survey theme/template: own server 
==================

Hi guys, I need to develop a plugin to allow participants to retrieve their token in a restricted survey. 
Participant would enter their email address and Limesurvey backend should send token to them.
I would like to add a recover section just below core code request. What's the event that get fired when such screen get shown?
 

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 month 1 week ago #269886 by DenisChenu
Replied by DenisChenu on topic Plugin event for token screen
My opinion : don't need a new event.

1. Add a link to the token page with www.limesurvey.org/manual/GetPluginTwigPath (replace github.com/LimeSurvey/LimeSurvey/blob/ma...omponents/token.twig )
2. Use www.limesurvey.org/manual/NewDirectRequest for the 2nd form

Or : replace the register system www.limesurvey.org/manual/BeforeRegister (then you can set ON/OFF on surey settings)

Or : www.limesurvey.org/manual/BeforeControllerAction (but i relly don'(t use this one)

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.

Please Log in to join the conversation.

More
1 week 6 days ago #270187 by LaCaraB
Replied by LaCaraB on topic Plugin event for token screen
DenisCHenu, I'm in a similar situation, I I was not able to make it work.

I tried to use beforeTwigRenderTemplate but it seems is not used.

I tried to use beforeSurveyPage and then tried to modify the content or the sTemplate, but nothing seemed to work as this seems to be overridden later or not ever used.

I could potentially at beforeSurveyPage catch the condition when the token.twig gonna be used and render a custom template, but not the ideal solution.

Can you share a tested implementation?

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 week 6 days ago #270188 by DenisChenu
Replied by DenisChenu on topic Plugin event for token screen

I tried to use beforeTwigRenderTemplate but it seems is not used.
 
Not beforeTwigRenderTemplate, www.limesurvey.org/manual/GetPluginTwigPath
Then you can totally replace an existing twig file.

Here : gitlab.com/SondagesPro/coreAndTools/auto...?ref_type=heads#L379

I use before survey page to attach to
Code:
beforeTwigRenderTemplate (
gitlab.com/SondagesPro/coreAndTools/auto...?ref_type=heads#L484 too)

And here finally to show what i want : gitlab.com/SondagesPro/coreAndTools/auto...?ref_type=heads#L585

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.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose