Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-07 15:28:45

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

[request] Custom pref plugin to set and use user defined settings

Wouldn’t it be great to be able to make grouped sets of fields in the advanced prefs that could be set by a site editor then used by the site via simple tags.

<txp:mrd_pref name="latitude" />

I think so.

Offline

#2 2011-06-07 15:32:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: [request] Custom pref plugin to set and use user defined settings

mrdale wrote:

Wouldn’t it be great to be able to make grouped sets of fields in the advanced prefs

smd_vars was my first stab at it, many years ago. Doesn’t add them to the advanced prefs but puts them on its own tab as a list; not too dissimilar. It could probably be made to do fill-in-the-blanks prefs.

It needs some spit and polish but it’d do what you wanted I think. I need a good excuse to give it a kicking.

EDIT: Alternatively, a better solution might be smd_prefalizer. Make the prefs up yourself now in that plugin, give them all the same event name (a name of your own choosing) and set their status to BASIC (to appear on basic prefs) or ADVANCED (for the Advanced prefs page). The event name puts them in a defined group and the position orders them to your liking. The html entry is supposed to be for the type of control it renders: text-input, radio set, etc, but YMMV.

That takes care of the input side. Then use <txp:smd_pref_get > to read in the values on the public side.

Oh, and if you want to get really freaky you can use <txp:smd_pref_set /> on an smd_tabber pane to allow people to define their own prefs. Howzat?

Last edited by Bloke (2011-06-07 15:41:31)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2011-06-07 15:52:36

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [request] Custom pref plugin to set and use user defined settings

There you go… Perfect.

Stef Dawson will now be playing the part of a search engine for lazy bums.

Offline

#4 2011-06-07 15:54:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: [request] Custom pref plugin to set and use user defined settings

mrdale wrote:

Stef Dawson will now be playing the part of a search engine for lazy bums.

:-) The downside being this search engine only knows how to find things beginning with smd_…

Last edited by Bloke (2011-06-07 15:54:59)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2011-06-07 17:05:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: [request] Custom pref plugin to set and use user defined settings

:-) The downside being this search engine only knows how to find things beginning with smd_…

… which might very nearly be all we need to know :-)


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB