Make HTML widget appear on specific URLs

Go down

Make HTML widget appear on specific URLs

Post by ioncube on May 2nd 2011, 8:12 am

Respected sir,
I have a HTML widget installed in my sidebar; which I want to appear only on a specific URL; so is there any coding block that I envelop my widget code within it such that my widget appears only on a specific URL page.
For blogger there were many
Code:
</b:if>
commands. Is THERE SOMETHING SIMILAR FOR FORUMOTION
avatar
ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by Beno on May 2nd 2011, 10:28 pm

Theres not a forumotion tool for this apart from only showing a widget to a certain group eg. member, guest admin ect.

Your best get is to find some javascript code that will check the url for certain parts and only display if there is. Try Google Very Happy

Thanks,
Ben
avatar
Beno
Hyperactive

Male Posts : 3024
Reputation : 67
Language : English
Location : England

http://www.benwhitedesign.co.uk

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by ioncube on May 3rd 2011, 1:00 am

looking for it....
avatar
ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by ioncube on May 3rd 2011, 7:54 pm

I am tired of looking; is Sir. BASE there he could atleast giv me a definite answer...
avatar
ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by Gangstar15 on May 3rd 2011, 8:00 pm

Hmm so you want it like that.
if the the url is https://help.forumotion.com/forum then widget will be shown and e.g if its https://help.forumotion.com/groups then it will be hidden (:
avatar
Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by ioncube on May 3rd 2011, 8:59 pm

yes....i want a widget only appear at my homepage...sort of tutorial widget which isn't needed always; just at homepage
avatar
ioncube
Forumember

Male Posts : 279
Reputation : 41
Language : eng
Location : Pakistan

http://defencedog.blogspot.com/

Back to top Go down

Re: Make HTML widget appear on specific URLs

Post by Gangstar15 on May 3rd 2011, 10:22 pm

Homepage = Forum index? (:
Give your widget a class or an ID (: and hide it with CSS

Code:
.widget class name {display: none;}

and try use this jQuery code:

Code:
<script>jQuery(document).ready(function(){
if (location.pathname=='/forum') {jQuery(function() {jQuery('.WIDGET CLASS NAME').addClass("widget-active");});};});
</script>

and try add this code to your CSS:
Code:
.widget-active {display: block !important;}
avatar
Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum