Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-11-08 23:16:15

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Global on/off switch for website functionality

I would like to build an “on/off switch” for a client’s website. When the switch is on, let’s say a JavaScript effect is enabled, like an occasional snowflake falling from the top of the screen. “Off” disables that JavaScript.

What would be a good way to build something like this into the admin interface?

Offline

#2 2010-11-09 00:03:20

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Global on/off switch for website functionality

You could use adi_variables to set a variable used in forms or pages to acctivate this feature.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2010-11-09 00:37:54

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: Global on/off switch for website functionality

Wow, I tried that and it really worked well. Thanks for the tip! I’ve got snow falling from my own website now, and I can’t remember why I ever hated this sort of thing. Maybe it will come to me.

I do wish I could use a checkbox rather than having the client type “on” or “1” or whatever, but I guess that’s OK.

Is there a plugin that I can use to customize the name of the tab (change “variables” to “controls” or something), or is that best done with JS?

Last edited by maruchan (2010-11-09 00:39:58)

Offline

#4 2010-11-09 00:39:33

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Global on/off switch for website functionality

I would use js to change the textbox to a on/off switch. Maybe something like this?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#5 2010-11-09 00:44:25

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: Global on/off switch for website functionality

Great idea. Thank you.

Offline

Board footer

Powered by FluxBB