We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Plugin to replace hHeader to Clickable advertising banners. | Forum

Topic location: Forum home » Support » General Questions
Asoka Janaka
Asoka Janaka May 16 '20
Could someone create us a plugin to replace the header space for an Advertising space. The banners should be clickable and we should be able to add banners in either jpg or png formats.


Kindly let us know with costs.

Marcus
Marcus May 17 '20
Asoka Janaka
Asoka Janaka May 17 '20
No i want the advertising banners to appear where the header is now. 
Marcus
Marcus May 17 '20
im sorry i pasted wong link. try this https://developers.oxwall.com/store/item/37
Asoka Janaka
Asoka Janaka May 17 '20
I have this plugin. But it places the banner under the header. May be some one can place it in the header. Thank you Marcus. Really appreciate it.
Asoka Janaka
Asoka Janaka May 17 '20
That plugin is designed for Adsense. You can't add banners
Marcus
Marcus May 17 '20

in admin panel - > page settings add this code to header part.. 

<script>

$( ".ow_header" ).html("your img link here" );
</script>

The Forum post is edited by Marcus May 17 '20
Asoka Janaka
Asoka Janaka May 17 '20
Ok Thanks
Marcus
Marcus May 17 '20
ill do it tomorrow ill need to use pc cant with cell phone. its as simple as adding a bit if jquery code to insertBefore or insertAfter try it yourself 
The Forum post is edited by Marcus May 17 '20
Asoka Janaka
Asoka Janaka May 18 '20
I tried it but didn't do anything.
Marcus
Marcus May 18 '20

Hi add this code to your custom tail section:


<script>

$('.ow_header').addClass('banner').removeClass('ow_header');


$(" .banner").html("<div>IMAGE REPLACE</div>" );

$(".banner").children('div').addClass("bannerInner");

</script>



<style type="text/css">
.banner{
    margin-top: 50px;
    width: 100%;
}

.bannerInner{
    text-align: center;
}
</style>

The Forum post is edited by Marcus May 18 '20
Asoka Janaka
Asoka Janaka May 18 '20
Thanks Marcus. Just came home from work will try and let you know
Asoka Janaka
Asoka Janaka May 19 '20
Hi Marcus i have done it. The image is showing on header now. 
Asoka Janaka
Asoka Janaka May 19 '20
But it is still not clickable 
dave Leader
dave May 19 '20

Either put the image code in the css or the html


for html


$(" .banner").html("<div><a href='whatever destination url'> <img src='Whatever image url' alt='advertisement' /></a></div>" );

The Forum post is edited by dave May 19 '20
Asoka Janaka
Asoka Janaka May 19 '20

<script>

$('.ow_header').addClass('banner').removeClass('ow_header');



$(" .banner").html("<div><a href=https://www.lycamobile.co.uk/<img src='https://swingdates.co.uk/...s/theme_image_42.png' alt='advertisement' /></a></div>" );


$(".banner").children('div').addClass("bannerInner");


</script>


This is what i have done. The image has completely vanished.

dave Leader
dave May 19 '20

no like this


$(" .banner").html("<div><a href='https://www.lycamobile.co.uk' target='_blank'><img src='https://swingdates.co.uk/...s/theme_image_42.png' alt='advertisement' /></a></div>" );


if you want it to load on the same page and NOT a new page on click then remove the target='_blank'

dave Leader
dave May 19 '20

Remember that if you are loading html in any way via php or js and you enclose that code in quotes then you need to either escape those quotes if you use the same or change to the other type of quote


Example:


php


1. escape example when you use all same type of quotes


echo "<a href=\"theurl\">whatever</a>";


2. changing quotes example double and single


echo "<a href='theurl'>whatever</a>";


3. changing quotes example single to double


echo '<a href="theurl">whatever</a>';


and it works the same if your loading it via js as well, you do this in order to tell the server and or browser what you want to do and with what info, it cannot read your mind :)



The Forum post is edited by dave May 19 '20
Asoka Janaka
Asoka Janaka May 19 '20
Perfect Dave. It is working Thank you very much. Oxwall should honour you for the support you provide. A knighthood if i am related to the British Royal Family. Sir Dave.
dave Leader
dave May 19 '20
Your welcome
The Forum post is edited by dave May 19 '20
Pages: 1 2 »