Skip to main content

WP Brizy Pro - Feature Request: Shortcode Display Conditions | Option if content of Shortcode is empty, set shortcode Wrapper visibility hidden / display none OR display custom text

Comments

2 comments

  • Doina P

    Hello Pascal,

    Thank you for your message!

    Regarding what you have said, we will try to implement this in the future. When it will be ready, we will tell you! Till then, if you have any other questions or problems, please feel free to ask. We will be happy to help.

    Have a nice day and best regards,

    Doina

    0
  • Pascal Brennecke

    I was able to write a small script with the help from stackoverflow that hides the shortcode div if it is empty.

    I gave the shortcode and the Text Element above it a ID. 
    It's still missing a checkup / end routine, therefore if there is a shortcode, it spits out an error inside the console.

    Have a look here https://stackoverflow.com/a/69349956/12347410
    (explanation in the SO comments)
    or here:

    function pgpSichtbarkeit() {
      var pgpShortcode = document.getElementById('Produktgrundpreis-Shortcode').innerText;
      // if (!pgpShortcode.trim())
      if (!pgpShortcode) {
          document.getElementById('Produktgrundpreis-Text').style.display = "none";
      }
    }
    
    pgpSichtbarkeit();
    0

Please sign in to leave a comment.