Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Listing Templates in use

Listing Templates in use 2 years 8 months ago #106052

  • macanics
  • macanics's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
Is there a method for listing all templates that are in use - i.e. selected for any survey? I'm looking for a way to cull our unused custom templates.

---john---
The administrator has disabled public write access.

Listing Templates in use 2 years 8 months ago #106056

  • amit01
  • amit01's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
Hi
I have not yet come across with such a method present in current version of LimeSurvey. I guess you will have to write it manually , if you actually need it.

--
cheers
amit
The administrator has disabled public write access.

Listing Templates in use 2 years 8 months ago #106065

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6567
  • Thank you received: 1477
  • Karma: 579
Sorry, no, you'll have to do it the painful way ;)
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 8 months ago by tpartner.
The administrator has disabled public write access.

Listing Templates in use 2 years 8 months ago #106069

  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Gold Lime
  • Posts: 241
  • Thank you received: 53
  • Karma: 13
The following solution is not painful if you understand a tiny bit of mysql:
Run the following sql statement in phpmyadmin, R or php

select folder,count(s.template) from
(SELECT * FROM `lime_templates` left join lime_surveys on folder=template
union
select * from lime_templates right join lime_surveys on folder=template ) as s
group by s.folder

This leads to a list of templates and the number of surveys that uses this template:
basic 0
bluengrey 0
citronade 1
clear_logo 0
default 2
DigiPsy 10
..
..

(I am not very good in sql, probably this can be done in a simpler way, but this works)
Frans
Last Edit: 2 years 8 months ago by fransmarcelissen.
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu
Time to create page: 1.179 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form