I am trying to: nest fields within fields in a Content Template.
I have the following three fields:
[types field='amazon-link'][/types][types field='disc-type' separator='/'][/types][types field='amazon-price' format='FIELD_VALUE'][/types]
I would like to have the "amazon-link" field encompass the other two fields (disc-type, amazon-price) so that the resulting line is a link. Something along these lines:
[types field='amazon-link' ((field='disc-type' separator='/')": $"(field='amazon-price' format='FIELD_VALUE')) target='_blank'][/types]
Can Toolset do this? I've not found any documentation that indicates how to nest fields within other fields.
Likely not. Those are enclosed ShortCodes and you would put values between the opening and closing tag ([types field='amazon-link']value here[/types])
As first I need to know the type and contnet of those Fields.
Then I need to know what exactly you want to produce.
Please can you provide me this info?
You can use nested ShortCodes as elaborated here:
https://toolset.com/documentation/user-guides/shortcodes-within-shortcodes/
And here is a explanation why Types ShortCodes are enclosed:
https://toolset.com/faq/why-do-types-shortcodes-have-to-be-closed/
The workflow is this:
"amazon-link" is a URL to go to an Amazon page.
"disc-type" is the type of product: DVD, BD, 3DBD, 4KBD, digital copy or video-on-demand. This is a checkbox field, as the products vary in their iterations. This is also the main reason I want to use WP-Types for this purpose.
"amazon-price" is the price that Amazon charges for the product.
The end result would be this: hidden link" target="_blank">Amazon BD/DVD/DC price: $22.99
If this can't be done, then it can't be done. But it seems such a simple concept: use the data entered in one field to represent another.
Well but what you want is a Link URL and a Link text.
So you can do this:
<a href="[types field='amazon-link'][/types]">Amazon [types field='disc-type' separator='/'][/types] price: $[types field='amazon-price' format='FIELD_VALUE'][/types]</a>
If you insert this in your Text Editor it will prodice a link like what you show me in your example.
You do not need to nest the ShortCodes.
Just pay attention to output the raw URL with your URL Field, so the "a href" receives the correct data.