• Resolved afeist

    (@afeist)


    Hi,

    I’m currently setting up a page where I use custom blocks

    One block that I setup looks like this:

    <section class="rk-section">
        
        <svg version="1.1" viewBox="0 0 1920 85" class="rk-wave">
            <path d="M1920.7,35.9c0,0-759.7-78.2-1286.4,13.4C131.4,136.8,0.7,35.9,0.7,35.9L0.8,0h1919.9V35.9z"/>
       	</svg>
    
        <?php block_field( 'rk-section-content' ); ?>
    
    </section> 

    and it is displayed corrently on the website as well.

    But for the an other block which looks like that:

    
    <div class="rk-div-heart">
        
        <svg version="1.1" viewBox="0 0 1920 85" class="rk-wave">
            <path d="M1920.7,35.9c0,0-759.7-78.2-1286.4,13.4C131.4,136.8,0.7,35.9,0.7,35.9L0.8,0h1919.9V35.9z"/>
       	</svg>
        
        <?php block_field( 'rk-heart-content' ); ?>
    
    </div> 

    The website actually skips the svg part entirely, just pulling in the content.

    Both blocks are identical in their data and php setup (just some changes in the styling).
    Is there something that I’m missing to have it work properly?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @afeist,
    Sorry for the delay.

    The website actually skips the svg part entirely, just pulling in the content.

    So the <svg> isn’t rendered at all on the front-end?

    Thread Starter afeist

    (@afeist)

    Hi Ryan,

    yes it’s just skipped, though I also have blocks that render the <svg> part on the front-end as well.

    Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @afeist,
    Sorry for the delay again.

    It sounds like that is an issue somewhere, but the .svg displays in my local:

    https://cldup.com/pc67yeDUCF.gif

    Using 2nd template you pasted:

    <div class="rk-div-heart">
        
        <svg version="1.1" viewBox="0 0 1920 85" class="rk-wave">
            <path d="M1920.7,35.9c0,0-759.7-78.2-1286.4,13.4C131.4,136.8,0.7,35.9,0.7,35.9L0.8,0h1919.9V35.9z"/>
       	</svg>
        
        <?php block_field( 'rk-heart-content' ); ?>
    
    </div>

    …at blocks/block-rk-heart.php

    Thread Starter afeist

    (@afeist)

    Hi Ryan,

    yes that’s what I figured, but I also wasn’t able to actually find any major difference as both are basically the same and should behave the same.

    I did some more tests and I was able to narrow the issue down a bit more:
    The <svg> does actually shows up in the front-end, BUT only if it’s not parented under any other Genesis block, using a default Gutenberg block (like Group) works fine.

    Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @afeist,

    BUT only if it’s not parented under any other Genesis block, using a default Gutenberg block (like Group) works fine.

    Oh interesting, was the block a child block, or inside InnerBlocks?

    Thread Starter afeist

    (@afeist)

    Yes the block was inside the InnerBlocks

    Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @afeist,
    OK, thanks. That sounds unexpected that it would strip the <svg>, but I’m not sure there’s anything we can do, as we use the Inner Blocks from Core.

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

The topic ‘Genesis Block missing content from block file’ is closed to new replies.