XF 2.2 How can I include this code in the forum?

Fecom

Member
Hello
How can I include this in the forum?

I get an error when I try to paste the above code in head, inside Page Container.

Thank you.
 
Solution
I get an error when I try to paste the above code in head, inside Page Container.

You'd need to embed this in a widget or something else other than trying to paste in the page container template, that just won't work based on how it's setup... see below. (based on the link you pasted)

The first part:
Code:
<div id="as-root"></div><script>(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n))return;r=e.createElement(t);r.id=n;r.src="//s.trackingmore.com/button/getbutton.js";i.parentNode.insertBefore(r,i)})(document,"script","trackingmore-jssdk")</script>
Can be put in the <head> section... within PAGE_CONTAINER template for each style.

The 2nd part, create a HTML widget and use the 2nd part...
I get an error when I try to paste the above code in head, inside Page Container.

You'd need to embed this in a widget or something else other than trying to paste in the page container template, that just won't work based on how it's setup... see below. (based on the link you pasted)

The first part:
Code:
<div id="as-root"></div><script>(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n))return;r=e.createElement(t);r.id=n;r.src="//s.trackingmore.com/button/getbutton.js";i.parentNode.insertBefore(r,i)})(document,"script","trackingmore-jssdk")</script>
Can be put in the <head> section... within PAGE_CONTAINER template for each style.

The 2nd part, create a HTML widget and use the 2nd part: (../admin.php?widgets/)
Code:
<div token="" class="as-track-button" data-color="448ef3" data-size="normal" data-express-code=""  data-hide-tracking-number="false"  data-width="600px" lang="en"></div>

I created a simple widget with this code in about a minute.

1651590376122.png

Widget Settings:

1651590494859.png

There are more pretty ways to do this, but this is just the most simple version.

Position in PAGE_CONTAINER:

1651590610533.webp
 
Solution
I'm going to contact the hosting company, to see if that's the reason.
This was the problem.
 
  • Like
Reactions: ENF
Top Bottom