XF 1.5 Can't Save Template Edit

Jim McClain

Member
I decided to try adding an Adsense ad that fits below the stickies in a thread list. I have used similar code that I found here in instructional threads, edited to suit my needs and my ad code. When I click the Save All Changes button, I get a nearly blank page that has only the date/time. See the 2 images below. I hope you can tell me what I might be doing wrong.

edit-template-1.gif


edit-template-2.gif
 
Do you have an ad blocker installed on your browser, or another extension which may be causing it?
Hi Brogan. No, I don't use ad blockers anywhere and I don't think a browser extension would be the issue. I can actually edit the template fine when I test it with:
HTML:
<div>Can you see me now?</div>

But I can't edit with the code you see in my attachment above. The Adsense code is a direct copy from my Adsense account. The rest is code I gleaned from a support thread here on XF (I prob'ly couldn't find it now to save my life :()
 
@Brogan I was hoping to hear back on this. Time past and I forgot about it, but I still have this problem. Could I be the only one who ever encountered this? I've searched the site and Google and can't find anything useful. I'm using XF 1.5.22.
 
Just for the heck of it, try saving the template with just <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
 
Okay, now try this:

HTML:
<center><div id="adsenseAd"><test async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></test>
<!-- square sidebar ad -->
<ins class="adsbygoogle"
     style="display:inline-block;width:250px;height:250px"
     data-ad-client="ca-pub-299659"
     data-ad-slot="23667236"></ins>
<test>
(adsbygoogle = window.adsbygoogle || []).push({});
</test></div></center>
 
Okay, now try this:
Hmmm, that worked, but I could not recreate it with the actual script I want to use.
HTML:
<center><div id="Viglink">
<script type="application/javascript">
var vglnk_cuids = vglnk_cuids || {};
vglnk_cuids["platform-55"] = "";
document.write('<div><scr' + 'ipt type="text/javascript" data-offerbox-id="55" data-api-key="3966787a4679402f8bf068a8edec0cab" data-width="300" data-height="250"> (function(d, t) { var s = d.createElement(t); s.type = \'text/javascript\'; s.async = true; s.src = \'//cdn.viglink.com/api/widgets/offerbox.js\'; d.head.appendChild( s ); }(document, \'script\')); </scr' + 'ipt></div>');
</script>
</div></center>
I tried it with a non-ID'd DIV and tried using inline centering style markup, but still no go.
 
It seems to be problem with the <script> tags. See if you can paste the above code into a post on your site. First in code tags, then without code tags.
 
Hmm, that is certainly strange.

What version of XF1 are you running? Have you tried to save the code in the template with all addons disabled? Are there any server errors logged?
 
What version of XF1 are you running?
1.5.22

Have you tried to save the code in the template with all addons disabled?
For this, I am using the latest version of the [bd] Widget Framework to create the template. I have previously edited a template to add Adsense code and had this same problem. I did disable all addons except the [bd] Widget Framework, but still had the same problem.

Are there any server errors logged?
None.
 
@ozzy47 It turns out the source of the problem was the WordPress plugin, Wordfence; it blocks what it thinks are malicious scripts. I found a setting that would allow me to work around this. Apparently, there is a very narrow definition of these "malicious scripts" because I have on several occasions added or edited scripts, including Adsense and Viglink code, without experiencing this problem.

Again, thanks for all your efforts. I'm glad the problem is finally solved.
 
Back
Top Bottom