Skip Navigation

[Resolved] Create "Global Variables" with something in Toolset?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by GTD9219 7 years ago.

Assisted by: Nigel.

Author
Posts
#593592

Is it possible to create "global variables" with Toolset? It seems it would be.

Simplest scenario = I have an affiliate ID that I want to append to some URLs. Toolset would allow me to append easily, and it seems this should technically be easy and doable, but I can't think of how to do it. Perhaps with a checkbox or dropdown custom field with a default-selection?

An important use case = what happens if I change the affiliate ID later?

I have searched the forum, but got tired of looking.

Thanks a lot!

#593897

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

This is not something that Toolset is designed for, or at least it isn't something that it is currently capable of.

The logical place to store such "variables" is in the wp_options table, and Toolset doesn't offer any way for users to interact with it.

Using Toolset I would:

- create an Options custom post type (you will only create one of these posts)
- create a custom field group assigned to Options where you add custom fields for the variables you want to store
- publish an Options post, noting its ID, and update the custom fields as required

Then, whenever you want to output a "variable" you do so with the types shortcode to display the custom field, adding the id attribute to specify the id of the options post where they are stored.

#594106

That's really clever and will work. Thanks!

The forum ‘Types Community Support’ is closed to new topics and replies.