Subscribe to Our Newsletter

x

How to Fix the Post Preview Bug Due to Connatix Video Ads

Some users have reported that when previewing a post in the Entry Editor with a Connatix video ad embedded, the video takes over the entire screen like in the following example:


The goal of this tutorial is to show you how to fix this issue. This should make the Connatix video embed normally in the post preview, the same way it should appear in the post after publishing. The result will be a preview that looks like the following:

In order to do this, Connatix suggested to us that users add a parameter in the ad that is then added dynamically just for the post preview. The parameter you need to add to the preview is the following string:

    preserve-iframe=1

The first global solution is to go into the Layout & Design tool and, from the Post page, insert the following code:

    <choose>
        <when test="getparams.draft=='1'">
         <write_to_header data-rm-friendly-name="Connatix Preview" data-rm-selected="true">
          <![CDATA[<script async type='text/javascript'
    src='https://cdn.connatix.com/min/connatix.renderer.infeed.min.js'
    data-connatix-token='902fce37-9cb7-4fb0-8307-fa65ef7168ef' preserve-iframe='1'>
          </script>]]>
         </write_to_header>
        </when>
         <otherwise>
          <write_to_header data-rm-friendly-name="Connatix">
           <![CDATA[<script async type='text/javascript' 
    src='https://cdn.connatix.com/min/connatix.renderer.infeed.min.js?production'
    data-connatix-token='902fce37-9cb7-4fb0-8307-fa65ef7168ef'>
           </script>]]>
          </write_to_header>
         </otherwise>
        </choose>

The code should be placed as the first block in the Post page as shown below:

However, this solution doesn't work when your advertisement/script is included by the Ad Manager (after x number of words).

To fix this, you can include a script in the Ad Manager itself to include the preserver-iframe=1 parameter dynamically there. You should include an ID in your advertisement script (located toward the end of the following code snippet):

    <script async type='text/javascript'
        data-src='https://cdn.connatix.com/min/connatix.renderer.infeed.min.js'
        data-connatix-token='a928293d-a011-457c-b7d7-1346b0ce87c3' id="post-{{post.id}}">
    </script>

After that, you can include the following piece of code in your Top Bar (so that the fix is always applied). This will only include the parameter fix when you're in a post draft.

    <script>
        var post = document.getElementById('post-{{post.id}}');
        var url = new URL(window.location.href);
        if (url.searchParams.get('draft')) { 
            post.setAttribute('preserve-iframe', 1); 
        } else { 
            post.src = post.getAttribute('data-src'); 
        }
    </script>

You're almost there! Fill out the form below and a Rebel will contact you within one business day.

x

A Look Inside the Only Creative Agency Powered by Deep Technology

Strategic development of product that supports content distribution, conversion, and loyalty.

RebelMouse is a creative agency fueled by a publishing platform with deep technology. Our expertise is rooted in media and content marketing because there is no other team that understands distributive publishing better than we do. There is also no other CMS on the market today that provides content creators with the tools they need to unlock sustainable growth backed by sticky monetization methods. RebelMouse blends product and strategy together to move the needle where it matters most — organic traffic and user growth, conversion to loyalty, and revenue growth.

Keep reading... Show less

New: Easily Remove Users + Transfer Content

We subscribe to the idea that we live in a universe filled with creators. With that said, not all creators are created equal, and sometimes they move on after a while. That's why we want to make sure our site administrators have complete control over who has access to their RebelMouse pages. We've launched a new user interface within our users dashboard that allows you to efficiently remove authors from your site. And during this process, you can also reallocate posts from one user to another in bulk. Here's a look at how it all works.

Keep reading... Show less

NEW: RebelMouse Native Comments with Notifications

Content creation is never static. To build an audience, it's important to ensure that your content is not only dynamic, but sparks a conversation.

Keep reading... Show less

You're almost there! Fill out the form below and a Rebel will contact you within one business day.

x

How to Add a Title to Section and Tag Pages

Sometimes you might find the need to put a title on a section page. Here's an example:

Here's how to do it:

Keep reading... Show less

Introducing New and Dynamic Styles in Particle Assembler

Content creators are the lifeblood of your web property and their time is precious. That's why at RebelMouse we're always looking to enhance the ways creators can shape their content into dynamic and engaging media.

Our Particle Assembler is an intuitive way to create stunning dev-free designs in just a few clicks. And now Assembler has more styles to make your content pop.

Keep reading... Show less