Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-07-07 21:38:18
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Custom theme options
Hello guys,
My name’s Lucas, hope you guys can help me with something…
How can I do something like this goo.gl/ZcgPm with Textpattern? (the Twitter Username and GA/Typekit fields). I wish I could set up this custom options on the admin panel so the clients can update the info by themselves.
Thanks in advance ;-)
Lucas
Last edited by lucass (2012-07-07 21:39:35)
Offline
Re: Custom theme options
Offline
#3 2012-07-08 16:57:16
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: Custom theme options
Welcome to the forum, Lucas!
I’m afraid we need a little more info on what you want to achieve, in order to provide you with an optimum solution. Are you simply making a decision on a CMS choice, or do you have TXP installed and want to solve something special?
Would this client-updatable info be article/product related (—> simply use TXP’s very own custom fields, a core feature, no plugin required), or author related (—> try plugin smd_bio), or shall it have no predefined, fixed relation to anything other than what the author actually gives it by placing it somewhere (—> adi_variables, mck_snippet or even TXP’s output_form)? … There are so many more use cases, needs and characteristics I’ve not thought of.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#4 2012-07-10 15:24:58
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Re: Custom theme options
Hi uli, thanks for the warm welcome!
Yes, I already have TXP installed.
I just want to know if it’s possible to create a “custom theme options” for clients. Like the ones we used to see on WordPress (e.g. goo.gl/ZcgPm) .
Is this possible with adi_variables?
Offline
Re: Custom theme options
Yes, you can do that with adi_variables:
- Just create a field for
twitter_usernameand a field fortypekit_idin the Content > Variables tab. - Include
<txp:output_form form="adi_variables" />at the top of your page template. - In your page template include
<txp:variable name="variable_name" />where you want the variable inserted, e.g.
<script type="text/javascript" src="http://use.typekit.com/<txp:variable name="typekit_id" />.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
or:
<p>Follow me on <a href="http://twitter.com/<txp:variable name="twitter_username" />">twitter</a>.</p>
Last edited by jakob (2012-07-10 16:05:25)
TXP Builders – finely-crafted code, design and txp
Offline
#6 2012-07-10 17:05:08
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Re: Custom theme options
Hey Jacob, thank you very much for your explanation. This is exactly what I was looking for ;)
Thanks everyone!
Offline
#7 2012-07-10 17:17:58
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Re: Custom theme options
Guys,one more thing just out of curiosity…
Is it possible to use Markdown instead of Textile?
Offline
Re: Custom theme options
Currently no, though there have been murmurs that it might surface in the future some time.
TXP Builders – finely-crafted code, design and txp
Offline
#9 2012-07-10 18:57:10
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Re: Custom theme options
I see. Thanks!
Offline
Re: Custom theme options
FYI, the murmurs were here
Offline
#11 2012-07-13 21:57:01
- lucass
- Member
- Registered: 2012-07-07
- Posts: 21
Re: Custom theme options
Thanks for the link, Phil!
Offline
#12 2014-09-18 14:29:58
- gfdesign
- Member

- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: Custom theme options
Dears
I am also looking for the way to create a theme options page for my clientes. But I’ve seen the ‘adi_variables’ plugin does not support differents input fields like checkboxes, radiobutton, textareas, etc such as glz_custom_field has.
Do you know another way to achieve a page like this?
Thanks
Last edited by gfdesign (2014-09-18 14:31:04)
Offline
Re: Custom theme options
Hola Fernando,
I think it would be logical to integrate these options into Preferences tab. Give me an example of what you need, and I’ll try to work something out.
Offline
#14 2014-09-19 03:16:03
- gfdesign
- Member

- From: Argentina
- Registered: 2009-04-20
- Posts: 401
Re: Custom theme options
etc wrote #283863:
Hola Fernando,
I think it would be logical to integrate these options into
Preferencestab. Give me an example of what you need, and I’ll try to work something out.
Hi Oleg.
Thanks for your reply. As lucass asked / showed at the beginning of this topic, I’ve also worked with some projects in Wordpress and it seemed me interesting the idea that user has the capability to change some values of his/her site. However, I wouldn’t put these options under Preferences because I think over there are technical options rather than options related to design of the site therefore only we as super admins should have access.
In others words, I would like be able to offer a website where the clients can change some stuff such as the logo, slogans, email contact, number of articles will show in the home, color or image of background, links to their social networks, some statics texts, the favicon, and so on. Probably ‘Theme options” is not the most accurate name inside of Textpattern. Maybe an appropriate name for this new tab could be ‘General setting’ or something.
For example, in Wordpress with the help of some plugins or frameworks, the superadmin can create an options page with a lot of fields along with their descriptions in order to be filled by the user than later they will be used in the pages of the site.
I hope the idea has been clear :D
Best regards
Offline
Re: Custom theme options
gfdesign wrote #283870:
However, I wouldn’t put these options under
Preferencesbecause I think over there are technical options rather than options related to design of the site therefore only we as super admins should have access.
Currently this is true: the preferences panel is unavailable to anybody below Managing Editor. From 4.6.0, this changes. The Prefs panel is going to be open to everybody, but only Managing Editors and above can see the Txp prefs.
This subtle change offers more granularity and better control over preferences. For instance, if you wanted to open up just the Comments prefs area to certain groups of people, you alter the prefs.comments privilege.
This also opens up the Prefs panel to plugin authors, offering fine-grained control over their prefs. They just register their plugin with the built-in prefs hook or their own callback, add the prefs to the database, then when appropriate privs are set, the prefs will appear on the panel for those groups.
Combined with this, unlimited custom fields smattered across the interface will allow you to collect and output arbitrary meta data. For example, adding meta fields to Users would allow you to collect additional user data like website, twitter links, etc, like smd_bio does. You’d still have the issues that only an admin can set these values, though, unless a plugin (like smd_bio) overrides this behaviour, so you might be better to collect these on a separate panel, such as Prefs. You can then output these in varying ways in your templates using the <txp:custom_field > tag.
None of this helps you right now of course, but I thought I’d just give you a taste of what you will be able to do at some point in future.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline