Jump to content
thirty bees forum

Where to add html before end of head & body tags for individual pages?


Recommended Posts

Posted

Where do I add my dynamic Trust Seal on specific pages, for example to about us and contact, etc pages? Do I put it in the CMS "page content"?

I really wanted it on every page but if it will slow down my site, I'll just put it on a few pages.

I have the code and it has to go before the ends of the and tags.

Please use layman terms and not nerd-speak! lol

Thanks! Steph

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

If you want to add stuff in the HEAD setion of your page, you have to do it in the hookDisplayHeader function of your controller. This is also where you would load custom css and Javascript files.

You can load a tpl from there and add your code in it.

For example, in the socialsharing module, look in the socialsharing_header.tpl of the module in your theme.

Oh and of course, you will have to register your module for this hook if it's not already done.

Posted

@alwayspaws wasn't that enough layman for you ? :) I think for the CMS pages when you write them in the back end there is button which shows you the HTML code. Just put the code wherever you need to show the seal. For other pages like product pages for example I believe you should find the matching tpl file and put the code in the body section of that file, again where you need it. I may be wrong so don't count 100% on what I'm telling :)

Posted

If you want to get 'hacky' then you can edit the header.tpl file and put it in there for your theme. TBH I do that for my Google Tag Manager code on PrestaShop.

I've edited my comment as there is a custom code section in the Preferences area, this isn't on PrestaShop so it's new to TB. This is where you can try putting in your Trust Seal for the header.

Posted

@alwayspaws This might be a question for Jonny :)

Does Transformer have the options for custom css, javascript, tracking and head code? Panda does, I've added code to css without problem but just to change the text color.

Might not be what you are looking for since I believe it will change all pages.

check: theme editor>custom codes

Posted

@mockob Nope! I don't understand hooks. :) Your instructions are more understandable to me. :) I'm aware of the CMS pages but

@DavidP and @MockoB - do I just add body tags before and after the text/javascript I was given?

Posted

@vzex said in Where to add html before end of head & body tags for individual pages?:

@alwayspaws This might be a question for Jonny :)

Does Transformer have the options for custom css, javascript, tracking and head code? Panda does, I've added code to css without problem but just to change the text color.

Might not be what you are looking for since I believe it will change all pages.

check: theme editor>custom codes

I've already added custom code to the transformer theme courtesy of help from Jonny, so I'm going to ask him again.

I really want it on all pages.

Posted

If you want it on all your pages, just go to /themes/yourtheme/header.tpl, edit that file and paste the code you've got at the proper place.

This is the general header file, you'll be able to paste it just fine between the head and body tag.

Or did I miss something ?

Posted

At first, I thought I should only have it on specific pages in case it slows down the site. Now I think I should try it on the whole site. You didn't miss anything! :)

Posted

It says: Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information.

Posted

Sublime indicates there is no tag in the header.tpl file. Should I add it myself?

BTW I'm doing this with my test site first and I also backed up the header.tpl file.

Posted

I did my own theme using the default one as a template, so I don't have this problem ;-)

What kind of code is it, Javascript ? It can be added to the custom code section in the back office too.

Posted

Add this before your tag

and

Add this before your tag

end of code

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...