Title: Making the shortcode dynamic
Last modified: November 27, 2020

---

# Making the shortcode dynamic

 *  Resolved [kyushubec](https://wordpress.org/support/users/kyushubec/)
 * (@kyushubec)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/)
 * Hello Marc,
    Sorry to bother you again!
 * I used your great shortcode to imbed the configurator as you know.
 *  [mkl_configurator product_id=1 classes=”container-class something-else”]
 * Now I have made a second product page, and I am using elementor which creates
   a “single product template” that is applied to all single products.
    This seems
   to mean when I specify a product ID in the shortcode, that ID is applied to all
   pages, so the two product pages I have made are embedding the same product.
 * Is there a way I can get the shortcode to default to the product page it is on?
 * Another way is if I make many elementor templates, but I’m having trouble getting
   that to go well.
 * If there is a way from the code end, that would be very helpful.
 * Thank you!
 * [https://woocommerce-384941-1559973.cloudwaysapps.com/product/meishi-ire](https://woocommerce-384941-1559973.cloudwaysapps.com/product/meishi-ire)
 * [https://woocommerce-384941-1559973.cloudwaysapps.com/product/passcase](https://woocommerce-384941-1559973.cloudwaysapps.com/product/passcase)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmaking-the-shortcode-dynamic%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [kyushubec](https://wordpress.org/support/users/kyushubec/)
 * (@kyushubec)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/#post-13715202)
 * Just a little update, I figured out how to create multiple templates, updated
   the shortcodes in each and used tags to force them to their correct pages.
    This
   works, but it will be nice if I can use one template so I can keep design changes
   consistent across product pages.
 * Thank you again if there is anything you can do to help.:)
 *  Plugin Contributor [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/#post-13715259)
 * Hi there,
 * I’m looking into this. I haven’t used that feature of Elementor, so I’m not sure
   what can be done in Elementor, but there has to be a way to have content which
   is specific to the current product, as in you add the shortcode on the product
   edit page and not in the theme editor?
 *  Plugin Contributor [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/#post-13715417)
 * So I’ve had a look, and you can use the dynamic fields in the shortcode block:
 * ![](https://i0.wp.com/i.postimg.cc/1tP7SbfH/image.png?ssl=1)
 * Once Post ID is selected, add `[mkl_configurator product_id=` in the before field
   and `]` in the after field:
 * ![](https://i0.wp.com/i.postimg.cc/Px435KDk/image.png?ssl=1)
 * This should produce the shortcode for the current product, so you don’t have 
   to use one template per product.
 * Note that I’m using an older version of Elementor, so they might have changed
   this slightly in recent versions.
 *  Thread Starter [kyushubec](https://wordpress.org/support/users/kyushubec/)
 * (@kyushubec)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/#post-13715475)
 * Hi Marc,
 * That worked perfectly!
    Thank you so much! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Making the shortcode dynamic’ is closed to new replies.

 * ![](https://ps.w.org/product-configurator-for-woocommerce/assets/icon.svg?rev
   =2263690)
 * [Product Configurator for WooCommerce](https://wordpress.org/plugins/product-configurator-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/product-configurator-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/product-configurator-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/product-configurator-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/product-configurator-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/product-configurator-for-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [kyushubec](https://wordpress.org/support/users/kyushubec/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/making-the-shortcode-dynamic/#post-13715475)
 * Status: resolved