The idea of creating Dynamic Shortcodes comes from our experience with Tokens, a feature we have in the Dynamic Content for Elementor plugin.
β
We rewrote the syntax from scratch with the main goal of improving performance, enabling things that were not feasible before and making it available for the entire WordPress system.
Contrary to Dynamic Shortcodes, Tokens was meant to be a very simple tool to insert dynamic values. It later grew other features on top of this base in order satisfy customers needs, but was not designed from the ground up for the added complexity.
This unfortunately shows up in its implementation, its design and functionality.
For starter, Tokens does not have conditions, loops, templates, ways to handle variables. It's architecture and implementation makes it impossible for Tokens to be extended.
Compatibility
Tokens is an Elementor's only tool while Dynamic Shortcodes targets many Page builders and editors.
Composability
Dynamic Shortcodes are fully composable. This means that one shortcode can be nested within the other without limit.
For example I can do a query whose attributes are set from ACF Fields, example:
{query:user @ role={acf:role}}
With Tokens this is not possible, as Tokens can only be composed in limited number of ways.
Power Dynamic Shortcodes
This is an extremely powerful tool that does not exist at all in Tokens. In short, administrators can save Dynamic Shortcodes snippets that can be reused many times (use many times, change once). Since they are written only by administrators they have no security restrictions.
Impact on loading time
While Dynamic Shortcodes has virtually no impact on a site loading time, Tokens unfortunately can have a considerable impact based on the type of Tokens enabled and their usage.
Summary
Features | Dynamic Shortcodes | Tokens |
Compatibility | Elementor Free | Elementor Free |
Speed of interpretation | π | π’ |
Show Custom Fields | β | β |
Manage Dates | β | β |
Executing expressions | β | Limited |
Manage conditions | β | β |
Support for nested values | β | β |
Speed of interpretation | β | β |
Loop for ACF Repeater | β | β |
Loop for ACF Relationship | β | β |
Loops | β | β |
Execute Query | β | β |
Variables | β | β |
Cache support | β | β |
PHP Functions | β | β |
Possible expansion by third-party developers | β | β |