Title: Variable code appearing
Last modified: March 24, 2019

---

# Variable code appearing

 *  [bighippo999](https://wordpress.org/support/users/bighippo999/)
 * (@bighippo999)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/variable-code-appearing/)
 * Hi,
 * We have a number of Text-Blocks setup with variables such as:
    `Mug {{item-desc}}
   This image is representative of the final product and the colours shown may vary
   slightly due to different displays and colour settings.`
 * That we use with:
    `[text-blocks id="desc-short-mug" item-desc="with the text'
   In Case of Emergency: Delete My Browser History'"]`
 * However some mugs we dont want to have a description so we use:
    `[text-blocks
   id="desc-short-mug" item-desc=""]`
 * The problem is if we forget to add item-desc (which is easy if we use the Add
   Block button) then the customers gets to see:
    Mug {{item-desc}} in the front
   end.
 * Can I suggest that if the variable hasn’t been set within the block, that rendering
   the frontend just leaves out the {{variable}} text?
    A further suggestion would
   be to pre-populate any variables with “” when you add a block to a post that 
   has variables. That alone wouldn’t resolve if you further edit the text block
   and introduce new variables, you’d still see the above for a variable not set,
   but it would really help as you wouldn’t have to remember what variables you’d
   setup in the block.
 * Thanks,
 * p.s awesome plugin, it works really well with woocommerce products to keep text
   uniform across ranges of products 🙂

The topic ‘Variable code appearing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/reusable-text-blocks_53c8f2.svg)
 * [Reusable Text Blocks](https://wordpress.org/plugins/reusable-text-blocks/)
 * [Support Threads](https://wordpress.org/support/plugin/reusable-text-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/reusable-text-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reusable-text-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reusable-text-blocks/reviews/)

 * 0 replies
 * 1 participant
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/variable-code-appearing/)
 * Status: not resolved