View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
13536Feature requestsPluginspublic2018-08-07 17:01
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Summary13536: Unable to use twig file from Plugin
Description

Previously : we can create view in plugin
It's great to create own page + update core page.
Don't find the good way currently

Additional Information

Exemple here : https://gitlab.com/SondagesPro/registerQuick/blob/master/views/registerForm.php

Needed to allow to show or not email + email required or not

OK : i can create own extended template, but how this template can be used by the plugin ( ? forced) and if user choose another template ?

When 3.0 come : i think i can register new twig file , if user template don't have it : get the default

Maybe : allow plugin to extend template ?
Then if we have a 'core and final' template : we are sure to have finally the view file

TagsNo tags attached.
Bug heat6
Story point estimate
Users affected %

Relationships

related to 13538 closedDenisChenu Bug reports Unable to update registerForm with beforeRegisterForm 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2018-03-26 17:26

developer   ~47217

@LouisGac : any project to allow twig file from plugin ? Something like :
F

Exemple here:
find register_form_plugin in template, if not => Mother template , If not => Plugin template
Something like that

LouisGac

LouisGac

2018-03-26 17:48

developer   ~47219

sure could be easy to do

DenisChenu

DenisChenu

2018-03-26 17:52

developer   ~47220

If i remind i spoke for "core twig" file ?
Currently : vanilla is the mother/grand-mother of all plugin, then core == vanilla.

But what happen when another user create a mother/grand-mother plugin ?
We can not add twig file ?

Maybe move vanilla to "If mother/grand-mother AND grand-grand-mother" don't have this twig file : get it in vanilla ?

LouisGac

LouisGac

2018-03-26 17:55

developer   ~47221

have a look to the question template rendering process:
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/LSETwigViewRenderer.php#L84

it doesn't depend on survey themes, nor on inheritance system

LouisGac

LouisGac

2018-03-26 18:08

developer   ~47222

but maybe you want an inheritance system for plugin?

DenisChenu

DenisChenu

2018-03-26 18:34

developer   ~47223

Yes : there are a way for Question, but plugin can not use Question ?

Maybe allow another alias in renderTemplateFromFile ?
Because renderTemplateFromFile get only via Template

Question do : get it in current template and mother template, if don't have => get from Question::Template get core views, die if no view

But all other part do : get it in current template and mother template, die if no file

I like to have a solution for any file (even if not by plugin)

For example : we add in core a new System : didn't know , say "Last Correction before Validate" using twig view in vanilla. If User template are no a child of Vanilla : what happen ?

Have a a renderPluginView is great, but didn't fix "When core add file to vanilla : what happen to other" ?
:)

LouisGac

LouisGac

2018-03-27 11:01

developer   ~47226

"I like to have a solution for any file (even if not by plugin)"

sure

DenisChenu

DenisChenu

2018-06-18 12:30

developer   ~48206

https://github.com/LimeSurvey/LimeSurvey/pull/1082

LouisGac

LouisGac

2018-06-18 12:35

developer   ~48207

\o/

markusfluer

markusfluer

2018-08-07 17:01

administrator   ~48735

Release 3.14.2+180807

Issue History

Date Modified Username Field Change
2018-03-26 17:23 DenisChenu New Issue
2018-03-26 17:26 DenisChenu Note Added: 47217
2018-03-26 17:48 LouisGac Note Added: 47219
2018-03-26 17:52 DenisChenu Note Added: 47220
2018-03-26 17:55 LouisGac Note Added: 47221
2018-03-26 18:08 LouisGac Note Added: 47222
2018-03-26 18:34 DenisChenu Note Added: 47223
2018-03-26 19:57 DenisChenu Relationship added related to 13538
2018-03-27 11:01 LouisGac Note Added: 47226
2018-06-18 12:30 DenisChenu Assigned To => DenisChenu
2018-06-18 12:30 DenisChenu Status new => resolved
2018-06-18 12:30 DenisChenu Resolution open => fixed
2018-06-18 12:30 DenisChenu Note Added: 48206
2018-06-18 12:35 LouisGac Note Added: 48207
2018-08-07 17:01 markusfluer Status resolved => closed
2018-08-07 17:01 markusfluer Note Added: 48735