What exactly does the Dynamic Content Switch field do? How is it used?
Can't find a way to add it to a DC page, was hoping it would switch values, eg 2 People - price is x 3 People price chnages to y.
What does it do? Can I have an example please?
What exactly does the Dynamic Content Switch field do? How is it used?
Can't find a way to add it to a DC page, was hoping it would switch values, eg 2 People - price is x 3 People price chnages to y.
What does it do? Can I have an example please?
Hi,
Thank you for contacting us.
The Dynamic Content Switch field in SP Page Builder is designed to toggle between predefined content values—typically used for showing/hiding content blocks (for example: Yes/No, On/Off, or two preset text variations). It does not perform calculations or dynamically change prices based on user selection.
So in your example (2 People = price X, 3 People = price Y), the Switch field would not automatically adjust pricing like that. It simply controls which content is displayed, not variable logic or conditional pricing.
For use cases like dynamic pricing based on selection (number of people, options, etc.), you would need:
A booking(SP Booking) or eCommerce system(EasyStore) that supports conditional pricing, or
Custom JavaScript logic to update prices dynamically.
-Regards.
Can u show me an example of how it's used as it is not made clear in the documentation -
....and BTW SPBooking is broken, the description formatting loss issue still isn't fixed. It needs a major overhaul to be of any use at all. Thanks
Thanks for your question 🙂
The Dynamic Content Switch field is not meant for calculations or price changes. It simply allows you to toggle between two predefined content outputs (for example: Yes/No, Show/Hide, Version A/Version B).
Simple Example:
Imagine you have a dynamic item with a Switch field called:
“Show Special Badge” (Yes / No)
In your Dynamic Content template, you could use it like this:
{if field:special_badge == "1"}
<div class="badge">Special Offer</div>
{/if}
If the switch is enabled (Yes), the badge appears.
If it’s disabled (No), nothing is shown.
Another Example
Switch field: “Layout Style”
Option A → Shows Layout 1
Option B → Shows Layout 2
You would conditionally render different content blocks depending on the switch value.
So in short:
✅ Used for conditional display
❌ Not for price logic or value calculations
❌ Not for dynamic user interaction like “2 people = X price”
I think, you can check the docuemntation again, it will help you more.
https://www.joomshaper.com/documentation/sp-page-builder/dynamic-content
OK I get what it does but my question is where do i add the code for it? I think u need to make some additional imahges and explanations to show HOW to use it not just what it does. I already have a use i tink but don't know how to implement it.
Actually its hard coded so it's not recommended to touch the code. But I will inform our team about it, so that they can update the documentation.