CMS Development

doroness
Member

Adding a fixed strip on LPs

SOLVE

We have several LPs for various templates (some HTML + HUBL some were made via the editor). 

We want to add a fixed strip with some CTA text to all of the LPs. Is there a global way to do it, or do we need to add id for each template or each LP?

Will modifying an existing template won't cause any issues with the pages based on it?

0 Upvotes
1 Accepted solution
Jake_Lett
Solution
Guide | Partner
Guide | Partner

Adding a fixed strip on LPs

SOLVE

Hi @doroness based on your reply I have two options you can choose from.

  1. Create a global module that you manually add to all of your templates.
  2. Add some javascript to your footer site settings to apply code to your entire site. This is a hammer approach but can work if you are good with javascript and can create rules around when your code fires. Below is an example script.
    <script type="text/javascript">
    window.addEventListener('load',
    function() {
    $('<div id="notice" style="text-align:center;position:fixed;top:0;background:#ccc;width:100%;padding:0.5rem;">This is a global notice</div>').prependTo('body');
    $( "body" ).css('padding-top',$( "#notice" ).height() );
    }, false);
    </script>

View solution in original post

3 Replies 3
Jake_Lett
Solution
Guide | Partner
Guide | Partner

Adding a fixed strip on LPs

SOLVE

Hi @doroness based on your reply I have two options you can choose from.

  1. Create a global module that you manually add to all of your templates.
  2. Add some javascript to your footer site settings to apply code to your entire site. This is a hammer approach but can work if you are good with javascript and can create rules around when your code fires. Below is an example script.
    <script type="text/javascript">
    window.addEventListener('load',
    function() {
    $('<div id="notice" style="text-align:center;position:fixed;top:0;background:#ccc;width:100%;padding:0.5rem;">This is a global notice</div>').prependTo('body');
    $( "body" ).css('padding-top',$( "#notice" ).height() );
    }, false);
    </script>
Jake_Lett
Guide | Partner
Guide | Partner

Adding a fixed strip on LPs

SOLVE

I have a few questions in order to make a definitive recommendation.

  1. Is your website and blog on the same HubSpot account?
  2. Do your landing pages share a global javascript file? Or are they a mixture (marketplace templates and custom templates)?
  3. Are these templates drag and drop or code based?

 

 

doroness
Member

Adding a fixed strip on LPs

SOLVE

Hi
1. No

2. A mixture - mainly custom

3. A mixture

Thanks!

0 Upvotes