External banners in custom html modules

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Jan 22, 2015 4:43 pm
Reply with quote
Report this post
My website is www.casino-online.bz and as you can see it is very slow cause it have many banners on it. All the banners are external: they are loaded from external websites. I created a custom html module for any banner and put the code inside.
Code example:
<script type="text/javascript" src="http://externalwebsite.com/ad.aspx?pid=349895&bid=4473"></script>

The website is slow because the custom html modules are sync.
I read I could use defer or async attribute for the javascript code, but it does not work for <IE9. So it is not a good solution.
My goal is to load the content and after that the banners (defer). Can you help me to find something that could defer/accomplish that?
User avatar
Expert Boarder

GK User
Thu Jan 22, 2015 9:14 pm
Reply with quote
Report this post
Hi,
I suggest to use Custom JS module : https://www.gavick.com/documentation/jo ... cted-pages
User avatar
Platinum Boarder

GK User
Thu Jan 22, 2015 9:22 pm
Reply with quote
Report this post
Why do you suggest such extension? It seems it does not defer/async nothing.
User avatar
Expert Boarder

GK User
Fri Jan 23, 2015 12:10 am
Reply with quote
Report this post
On JED there is over 10 extension which you can use, check reviews. We are not consulting company.
User avatar
Platinum Boarder

GK User
Fri Jan 23, 2015 9:45 am
Reply with quote
Report this post
It is very strange that you continue suggesting me extensions to add custom code, cause my code works good and banners display correctly.
I only need to display before the content and then as last thing the banners. I need something to defer or asyncronize the banners. I know that you are not a consulting company, but you do not need to suggest me code, write css instructions,...
only a suggestion how to show banners as last thing. If you know it thank you, if you do not know, never mind.
User avatar
Expert Boarder

GK User
Fri Jan 23, 2015 11:11 am
Reply with quote
Report this post
I wasn't clear sorry, I thought about plugins with Javascript Async and Defer features.
But I'm not sure if they will work with external JS source.
User avatar
Platinum Boarder

GK User
Sat Jan 24, 2015 5:30 pm
Reply with quote
Report this post
I think I found a solution. Create a php file (pippo.php) that contains the affiliation code:
<script type="text/javascript" src="http://externalwebsite.com/ad.aspx?pid=349895&bid=4473"></script>

Write into custom html module:
<iframe width="300" height="250" frameborder="0" scrolling="no" src="/pippo.php"></iframe>

Do that for all 30 banners of mine. In this way all the banners are loaded async.
Question:
Is there a way to say to gknews2 template that the right sidebar is an iframe? (So I will not have to edit 30 fields and create 30 php files)
User avatar
Expert Boarder

GK User
Sat Jan 24, 2015 6:57 pm
Reply with quote
Report this post
Customizing template file layout/default.php
User avatar
Platinum Boarder


cron