Actions

Talk

Public Survey Views: Difference between revisions

From LimeSurvey Manual

mNo edit summary
mNo edit summary
Line 15: Line 15:
Remember: in Drupal a template is what a view is in LimeSurvey
Remember: in Drupal a template is what a view is in LimeSurvey


 
================
:Isn't this what we basically already have in place? [[User:Olle|Olle]] ([[User talk:Olle|talk]]) 10:44, 18 August 2016 (CEST)
:Isn't this what we basically already have in place? [[User:Olle|Olle]] ([[User talk:Olle|talk]]) 10:44, 18 August 2016 (CEST)
 
================
Basically this is more: currently you can only override a view (after configuring this in the config.php). What I propose goes further:
Basically this is more: currently you can only override a view (after configuring this in the config.php). What I propose goes further:
* when you choose "default" as the base theme and build your own "custom" theme on top of that, all files in the "default" theme are used and after that all files in the "custom" theme are used. So you can just override js, css, templates and so on. Therefore I would propose to put the whole views structure in that default theme and let other themes either make use of that or override it, while still using the js, css atc.
* when you choose "default" as the base theme and build your own "custom" theme on top of that, all files in the "default" theme are used and after that all files in the "custom" theme are used. So you can just override js, css, templates and so on. Therefore I would propose to put the whole views structure in that default theme and let other themes either make use of that or override it, while still using the js, css atc.
* I propose to make this multi-layered: based on "custom", you can make "custom-red" which uses the "custom" theme (that is based on the "default" theme) but (for example)  only makes the background of the question red.
* I propose to make this multi-layered: based on "custom", you can make "custom-red" which uses the "custom" theme (that is based on the "default" theme) but (for example)  only makes the background of the question red.


I realise that we will need to provide something for views that result from plugins. Drupal uses hooks and preprocess functions for that, but I am not knowledgeable enough in coding to explain that. I guess that you will grasp this concept.  [[User:Tammo|Tammo]] ([[User talk:Tammo|talk]])
I realise that we will need to provide something for views that result from plugins. Drupal uses hooks and preprocess functions for that, but I am not knowledgeable enough in coding to explain that. I guess that you will grasp this concept.   


Example from my Drupal adventures: I base all my work on the Drupal basic Bootstrap theme. I therefore have created a "TFR Cleanboot" theme, that has functionally all things that I need for my websites. "TFR Cleanboot" is based on the Drupal basic Bootstrap theme. All my customer themes I build based on "TFR Cleanboot". There is of course a performance issue: layering this all makes the CSS files bigger, but it is much easier for people to make their own themes. And I think that more than 90% of the surveys are for small audiences, where performace is not an issue. People that need speed, will have to use the default template or build one from scratch...
Example from my Drupal adventures: I base all my work on the Drupal basic Bootstrap theme. I therefore have created a "TFR Cleanboot" theme, that has functionally all things that I need for my websites. "TFR Cleanboot" is based on the Drupal basic Bootstrap theme. All my customer themes I build based on "TFR Cleanboot". There is of course a performance issue: layering this all makes the CSS files bigger, but it is much easier for people to make their own themes. And I think that more than 90% of the surveys are for small audiences, where performace is not an issue. People that need speed, will have to use the default template or build one from scratch...
Line 29: Line 29:
  1. clone the default and change everything that you want
  1. clone the default and change everything that you want
  2. start from scratch (I wish you good luck, since we (more or less) ended up doing that, but it is a lot of work)
  2. start from scratch (I wish you good luck, since we (more or less) ended up doing that, but it is a lot of work)
[[User:Tammo|Tammo]] ([[User talk:Tammo|talk]])

Revision as of 15:32, 18 August 2016

I ( Tammo (talk) )would strongly encourage a structure as there exits in Drupal 7 (by default, without additional settings in configuration files): [I do not know Drupal 8 yet, this uses Twig. I remember that Twig was also mentioned in the LimeSurvey community, but this seems very silent now]

  • base views are either in core (all of them at a clearly defined place) or in the base template under views (preferred by me, because then all theme files are together.
  • each template may either start from scratch (you then have to write all views) or rely on the core templates, with the possibility to override them
  • a template can also be a sub-template of a sub-template.

So for example:

  • in the default distribution there is the default template (in XLM file: Base=default)
  • in the default distribution there are also two sub-templates of the default template, this is indicated in the template xml file (Base=default)
  • a user can define his own template, so he has to write all views himself
  • another user may define a new template based (called "my-template") on the default (in xml file: Base=default) and may also define three color variants (called "red", "green" and "blue"), each based on my-template by referring to that template in the xml file: Base=my-template

http://themery.com/dgd7/theming/templates/override Remember: in Drupal a template is what a view is in LimeSurvey

====
Isn't this what we basically already have in place? Olle (talk) 10:44, 18 August 2016 (CEST)
====

Basically this is more: currently you can only override a view (after configuring this in the config.php). What I propose goes further:

  • when you choose "default" as the base theme and build your own "custom" theme on top of that, all files in the "default" theme are used and after that all files in the "custom" theme are used. So you can just override js, css, templates and so on. Therefore I would propose to put the whole views structure in that default theme and let other themes either make use of that or override it, while still using the js, css atc.
  • I propose to make this multi-layered: based on "custom", you can make "custom-red" which uses the "custom" theme (that is based on the "default" theme) but (for example) only makes the background of the question red.

I realise that we will need to provide something for views that result from plugins. Drupal uses hooks and preprocess functions for that, but I am not knowledgeable enough in coding to explain that. I guess that you will grasp this concept.

Example from my Drupal adventures: I base all my work on the Drupal basic Bootstrap theme. I therefore have created a "TFR Cleanboot" theme, that has functionally all things that I need for my websites. "TFR Cleanboot" is based on the Drupal basic Bootstrap theme. All my customer themes I build based on "TFR Cleanboot". There is of course a performance issue: layering this all makes the CSS files bigger, but it is much easier for people to make their own themes. And I think that more than 90% of the surveys are for small audiences, where performace is not an issue. People that need speed, will have to use the default template or build one from scratch...

Making a completely new theme would be: either

1. clone the default and change everything that you want
2. start from scratch (I wish you good luck, since we (more or less) ended up doing that, but it is a lot of work)

Tammo (talk)