Okay
  Public Ticket #1658221
certain html not working in Block Content
Closed

Comments

  • Ara Bozadjian started the conversation

    I'm using a non-wordpress calendar that I'd like to embed on the home page of my hemma theme site. I can embed it fine on a normal Page but it won't work on my home page using BLOCK BUILDER. When I paste the same code into BLOCK CONTENT it delete's part of it and doesn't work.

    Embed code attached. View in file, what it's displaying below is what it cuts it down to in the BLOCK CONTENT section.

    .vrbc-embed-container{min-height:420px;position:relative;padding-bottom:7.50%;height:0;overflow:hidden;max-width:100%}.vrbc-embed-container embed,.vrbc-embed-container iframe,.vrbc-embed-container object{position:absolute;top:0;left:0;width:100%;height:100%;background:none;}@media screen and (max-width:595px){.vrbc-embed-container{min-height:420px}} .vrbc-embed-container{min-height:420px;position:relative;padding-bottom:7.50%;height:0;overflow:hidden;max-width:100%}.vrbc-embed-container embed,.vrbc-embed-container iframe,.vrbc-embed-container object{position:absolute;top:0;left:0;width:100%;height:100%;background:none;}@media screen and (max-width:595px){.vrbc-embed-container{min-height:420px}}

    Attached files:  calendarembedcode.rtf

  •  116
    Pasquale replied

    Hi Ara,

    You've been not trying to add just HTML but an iframe. That happens because every block content field is escaped (the same thing happens if you try to paste that code into a blog post): in other words, to avoid malicious attempt to inject code into your website, iframes and scripts aren't executable on that areas. Hope that makes sense

    You could disable escaping this way (even though I would not recommend it): install and activate the child theme. Copy the file template-composer.php from the parent theme and paste into the child theme directory. Open the copied file and remove the escaping function from the block where you want to add a calendar.

    P.

  • Ara Bozadjian replied

    Hi Pasquale, thanks for your quick response.

    I'm not a developer/coder, what you suggested sounds terrifying to me to attempt. I've just about managed to get the theme set up and populated by swapping out your demo content.

     I don't think I have any other choice than to remove the escaping function. I'll ask the creators of the calendar if they have an alternate way to embed their calendars but I'm still not sure exactly what would/wouldn't work.

    I bought the calendar because it said "HTML is allowed" under the Block Content field. Is there any way you can remove this function for me please? Or send me a more detailed breakdown of how to do it please?

    Ara

  •  116
    Pasquale replied

    Hi again,

    HTML is allowed but not iframes (i.e. what you're trying to embed). In your case that is easier than you may think: what kind of block will you use for the calendar? 

  • Ara Bozadjian replied

    I thought iframe was HTML... ?? 

    What do you mean by what kind of block will I use? I'm using a 3rd party PHP Script. The only option it gave for embedding the calendar was that iframe code I attached below.

  •  116
    Pasquale replied

    Only a few HTML tags are allowed for security reasons. What block you want to remove the escaping function from?

     

  • Ara Bozadjian replied

    ohhhhhhhh.... sorry. 

    Custom full background block.

  •  116
    Pasquale replied

    Please see the screenshot:

    That is the file template-composer.php. Copy that into the child theme folder. Replace <?php echo do_shortcode( wpautop( wp_kses_post( $block_content ) ) ); ?> with <?php echo do_shortcode( wpautop( $block_content ) ); ?> and make sure to activate the child theme. That should work.

  • Ara Bozadjian replied

    Really really appreciate the quick responses and help Pasquale but you're giving me far too much credit. I have no idea what the child theme folder is or where to find it. I really don't want to do anything that could possible mess up the site as it's taken me so long to piece it together.

  •  116
    Pasquale replied

    The child theme folder is located inside the package you've downloaded from the ThemeForest (hemma-child.zip). You can upload the child theme the same way you did with the parent theme. Then you should add the template.composer.php file from the parent theme to the child one and make the changes that I showed you. Don't remove the parent theme or it will not work. Activate the child theme and you've done. If you follow these steps you will not lose anything: data, images and settings are saved into the database and not in theme's files. Hope that helps

  • Ara Bozadjian replied

    Ok, finally got around to do this. It doesn't appear to have worked. 

    1. do I delete the template.composer.php file from the parent theme?

    2. I have lost my top left logo and menu settings in the transition.

  •  116
    Pasquale replied

    Hi Ara,

    1. I've never to told to remove the original template-composer.php file from the parent theme so don't do that, it will break your theme.

    2. I can't advice without seeing your site, do you have any URL to share with me?

    P.

  • Ara Bozadjian replied

    Hi Pasquale,

    Correct, you didn't say that and i didn't remove it. Just can't figure out what I've done wrong as it's still not working.

    http://destinyvillajamaica.com - pwd: walkthisway@6

  •  116
    Pasquale replied

    What happens if you activate the parent theme again? Does your logo shows up?

  • Ara Bozadjian replied

    Correct. Just reactivated parent Hemma theme and logo and menu are back as before. Block Content under AVAILABILITY header on main page is still just code. 

  •  116
    Pasquale replied

    It doesn't make any sensecan you please reply with a private comment and provide me your WP credentials?

  •   Ara Bozadjian replied privately
  •  116
    Pasquale replied

    Trying to figure out what happens. Please don't touch anything, I'll come in touch shortly.

  •  116
    Pasquale replied

    Here I am again.

    1. Please let me explain how child theme works: All Customizers options are stored in the database and, if you switch to another theme (i.e. your child theme), the options remain bound to the original one. In other words, you should not lose the Customizer settings when activating the child theme.

    For some reason (maybe hosting-related), you're unable to preserve the parent theme settings when activating the child theme. I guess that your site is hosed on BlueHost or any other hosting companies that provides a built-in / tweaked WordPress installation. In facts, there is a Cache option that is not provided by the WordPress core. I am afraid that could be the issue.

    The good news is that you can easily re-configure the child theme, it should only take a few minutes.

    2. As per the calendar you've trying to embed, it doesn't work because the code in the screenshot does nothingany CSS should be wrapped in a <style> tag or the browser will treat is as plain text. In addition, I can just see an empty div, so I am wondering what do you expect to see there. Hope that makes sense.

    Cheers, P.

    Attached files:  Screen Shot 2018-08-02 at 14.20.43 PM.png

  • Ara Bozadjian replied

    And I'm back again too.

    1. Ok, so I just have to re-do what  done for the menu? That's fine. It didn't take that long.

    2. The code IS wrapped in a <style> tag. Please see attachment AND very 1st txt doc I attached where you can copy/paste the code for yourself. After I paste the code and save it, the 1st chunk of code is chopped off.

    Be great to try and resolve this soon, I am still pushing the calendar makers for alternative embed options. But this is a deal breaker for me. I have to have this calendar working on the site. 

    Attached files:  Screen Shot 2018-08-02 at 14.08.48.png

  •  116
    Pasquale replied

    Added a new modified files to the child theme and it works now

  • Ara Bozadjian replied

    AMAZING! Thanks Pasquale. Glad we got there in the end, not sure exactly what you done but I'll work with it.

    Thanks again.

  •  116
  •   Ara Bozadjian replied privately
  •  116