Support » Plugin: Reusable Text Blocks » 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.


    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.