Welcome to the LimeSurvey Community Forum

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

Is there any way to integrate LimeSurvey into a CMS?

  • modifiedcontent
  • modifiedcontent's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154545 by modifiedcontent
Is there any way to integrate LimeSurvey into a CMS?

There was a way to add an external header and footer apparently, but is deprecated since 2.0.

The .pstpl files make it impossible to do anything with php in the templates.

There was an include workaround with javascript; ugly hack that I can't get working in my case.

iFrame is also not an acceptable solution.

How do people use/post LimeSurvey surveys in their sites?
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
6 years 10 months ago #154626 by tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago #154698 by LouisGac
depends which CMS.

LimeSurvey use the Yii Framework. Joomla uses an "object oriented code", and a classical web application architecture. So it's possible to integrate a Yii application inside Joomla, but it's not easy, it's a huge job. Here a page about how to do it for a simple module (could be used for frontend rendering):
www.yiiframework.com/wiki/137/include-yi...-in-a-joomla-module/

Main problem will be to deal with session, and name space conflict between Joomla and Yii (Joomla 3 still doesn't use a proper name space system, it will be the case for Joomla4)

About Wordpress and Drupal: they are not really object oriented. Drupal is based on "Hooks" and "events", and it's rather made for "mouse users" than developers. So I bet that integrating a Yii application inside Drupal is pretty much impossible to do. Wordpress code is a little bit cleaner and more flexible, so you can give it a try too:
www.yiiframework.com/wiki/144/run-an-yii...e-an-wordpress-page/
www.yiiframework.com/wiki/213/integratin...et-another-approach/

So rather than "integrating" LS inside a CMS, you'd rather use LS as an external API, and build a component for your favourite CMS to request that API (like the Drupal component Tammo suggestested you). This can be easily done for small backend operations, but not really for frontend rendering.
The topic has been locked.
  • modifiedcontent
  • modifiedcontent's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154715 by modifiedcontent
Replied by modifiedcontent on topic Is there any way to integrate LimeSurvey into a CMS?
Thanks for the suggestions. The CMS I use is Processwire , but I don't need full integration, just basic things like adding my main site's header and footer to a survey or embedding a survey into a page in my CMS.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago - 6 years 10 months ago #154739 by LouisGac
you can add your site's header and footer to a LimeSurvey template, that would be very easy to do.

To integrate a survey inside your CMS page you have 3 possibilities:
1. Use an iFrame (easy and fast)
2. Create a processwire module that will query the LS database and recreate the frontend (very long work)
3. Integrate Yii inside Processwire so you can directly call the LS method inside a Processwire module (hard, maybe not doable)
Last edit: 6 years 10 months ago by LouisGac.
The topic has been locked.
  • modifiedcontent
  • modifiedcontent's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #154793 by modifiedcontent
Replied by modifiedcontent on topic Is there any way to integrate LimeSurvey into a CMS?
No you can't. The LimeSurvey templates are .pstpl, so you can't use php. You'd have to use static html.

iframe sucks. It is not an acceptable solution. iframes are not responsive, cause all kinds of CSS issues.

So I guess the short answer is, no, LimeSurvey cannot be integrated into your website.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 10 months ago - 6 years 10 months ago #154800 by LouisGac
1. There is no relation between pstpl files and the author's problem. BTW, you'll be happy to learn that the next major release of LimeSurvey will use twig instead or replacement keywords: github.com/LimeSurvey/LimeSurvey/blob/de...ews/layout_main.twig

2. iFrame should not be used to build an application. But it's a correct solution to mashup applications. Most of the survey applications use iFrames to be embedded in another page. They don't cause any CSS issues: only the CSS of the iFrame is loaded inside the iFrame. They can be responsive: it just need some JS both on host and iframe.

Real question is: should a survey be embedded in another page? If it's very short and displayed on a computer screen: why not. But in mobile first approach, showing the survey in a new tab seems just better.
Last edit: 6 years 10 months ago by LouisGac.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose