Skip Navigation

[Resolved] Add dynamic field within a content type

This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 7 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#450345

Hi,

So I have created a content type. Everything is working well thus far. What I want to do now is add another field within this same content type where I can select content from this content type. The new field is Administrative Assistant, which in dynamic content based on the Title field. Is that possible?

Hope I explained that properly.

Thx,
dL

#450472

Nigel
Supporter

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

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

Hi David

I'm not sure I have understood very well what you are looking to do, but if you want to add a custom field (e.g. a select dropdown) to your custom post type and have the contents of that custom field populated dynamically, then you will need to write custom code to do that (or get someone to do it for you, we have a link to certified partners at the foot of these pages).

The content of custom fields is either set up by the site admin (e.g. defining checkbox options when creating the custom field) or by the site users (e.g. entering text in a single line text field), but not programmatically, unless you set that up yourself.

You can see a description of the Types fields and their options here: https://toolset.com/documentation/customizing-sites-using-php/functions/

If I have missed what you are aiming to do then please let me know.

#450698

Ok, so here's the setup. I have one custom content type called <b>People</b>. The only built-in WordPress field I am using is <b>Title</b>. I have created other fields, such as Image, Job Title, Department and Administrative Assistant. I also have Taxonomy; Faculty, Graduate Student and Administrative Assistant. All <b>People</b> will be added to this custom content type. But Faculty have an Administrative Assistant. So, when I add a Faculty, they should also have an Administrative Assistant, which probably has already be added to the how can I select an Administrative Assistant, which has ready been added to the <b>People</b> custom content type. So, how can select an Administrative Assistant which has already been added to the custom content type? Remember, we are only dealing with this one custom content type.

thx,
dL

#450867

Nigel
Supporter

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

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

Hi David

You are trying to populate a select box with a list of posts (of the people post type).

That's not possible with Toolset, I'm afraid, that is pretty much the scenario I described above where you would need to write a custom solution for it.

That would involve some PHP to run a query to retrieve the list of Admin Assistants, which you would make available to the browser using wp_localize_script, and you would use jQuery to take that list to build the select box options.

If that doesn't sound like something you are able to do yourself you will need to contract someone to do it for you.

This seems like a good candidate for a feature request and I am filing one internally to see if populating a custom field with a list of posts (or users) can be added. If it gets accepted it will still take time to be implemented, so it is not going to help you on this project, I'm afraid.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.