Paste the JavaScript snippet just above the closing header tag of your HTML pages.

Permalink
I am required to add a javascript snippet to any page that has a payment link on it on my site and I can't find where to access the html code for the pages that have been built using C5.

Can anyone help me to access this so that I can add the javascript?

 
jero replied on at Permalink Reply
jero
Most probably you would want to put this into the theme files. You'll find them in a couple of places depending on your configuration. They'll either be in themes/<theme_handle> or in packages/<package_handle>/themes/<theme_handle>. Most likely in the elements sub folder you'll find a header.php and footer.php which are used on every page.

As an alternative, you could simply edit each page and add an html block and paste the code in there.
financefeast replied on at Permalink Reply
Hi Jero,

Thank you for answering. This is a new process for me and I'm still a little unclear about where to find the right place. I am in my cPanel and have seen several files that might be what you are describing but not sure.

Here are what the instructions tell as to where to put the snippet:

5. Paste the JavaScript snippet just above the closing header tag of your HTML pages. This is best practice. Please Note: If you are unable to edit the header of your page, the JavaScript Snippet can be placed anywhere within the html on your page and the badge will be returned.

TIPS
To ensure the best experience for your customers with the addition of the ClickBank Trust Badge:

Include a DOCTYPE declaration at the top of your HTML so that your page doesn't render in [quirks mode]. Click here for information about quirks mode.

Will the info you provided still be the right place to go?

How do I know what is the right place to put the snippet?
jero replied on at Permalink Reply
jero
OK, so in cpanel there should be a public_html folder. In there there's going to be a themes and packages folders. If your theme was installed from the marketplace, it'll be in packages otherwise it should be in themes. If you're using one of the built in standard themes it may also be in concrete/themes.

What you'll need to do is open the cpanel file manager, navigate to the appropriate themes folder, and then in there there's probably going to be an elements folder which will have a header.php file. you'll need to edit that (I think you right click it in the cpanel file manager) and then paste in your js code.
financefeast replied on at Permalink Reply
Thank you for all the help. I have gone through my cPanel and looked for
every instance I could find of a header.php file and added the snippet.
Now I just have to wait for confirmation that the changes have taken effect
as needed.

Hope you have a great week!!
financefeast replied on at Permalink Reply
Hello again,

The snippet is in place and working but not exactly as it needs to be. When I am inside concrete 5 and editing the snippet looks as if it works the way that it should, here is a link to a screenshot of how the badge is suppose to look -http://screencast.com/t/FqYzBiIkH9xk...

But when someone looks at the page outside of the edit mode the badge gets cut off, here is a screenshot of what this looks like -http://screencast.com/t/NBhOkkIc...

Do you have any suggestions as to what needs to be done in order to fix this issue?

Thank you again for all the help.
jero replied on at Permalink Reply
jero
So, if I follow what you're saying, when you're logged in as admin, all
is well, but when you're not, it's broken.

My guess would be that there is a dependency in the javascript. Most
likely it needs jQuery. You may have an error if you open your web
browser console (F12 usually does this),

If you can identify what the dependency is, then you may need to force
it to be loaded.

You can do this by altering your theme's page_theme.php which you will
find in the theme folder.

You need to add to the registerAssets function, or define it:

function registerAssets () {
   $this->requireAsset('javascript', 'jquery');
}



On 20/01/2016 07:13, concrete5 Community wrote:
financefeast replied on at Permalink Reply
There are a couple of tips in the instructions, please see this link -

https://support.clickbank.com/entries/97718397-Implementation-Guide-...

Could this be what you are referring to?

Thank you!
jero replied on at Permalink Reply
jero
No - none of that really relates. It would appear to be a self contained piece of code.
From the look of those screen shots, perhaps some of the code is hidden behind the c5 tool bar. It's difficult to tell without looking at the actual code.

Where is the site? If you'd rather not disclose this publicly, PM me with the details and I'll see if I can spot anything.