The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Displaying Widgets Only on Homepage

5 posters

Go down

Displaying Widgets Only on Homepage Empty Displaying Widgets Only on Homepage

Post by ELTP November 16th 2017, 3:20 pm

Technical Details


Forum version : #Invision
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
Forum link : http://www.duelmasters.org

Description of problem

I looked into this matter in the help board but couldn't seem to find code for invision forums. So we have widgets on the both sides of the actual forum, and would like to hide them outside the home page.


ABOVE PROBLEM IS MY MAIN CONCERN but I'd love to have the following problems solved as well.
I also have problems with hiding the forum name in the navigational category chain (would love to hide it on the homepage as well).

Then I haven't yet successfully implemented code that would reduce the spacing between different categories thus making the forum feel more "whole".
ELTP
ELTP
New Member

Male Posts : 18
Reputation : 2
Language : English and Finnish

http://duelmasters.foorumini.com

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by Mr.SnOuP November 16th 2017, 4:58 pm

Hello ,

Go to :
Administration Panel>  MODULES> HTML & JAVASCRIPT> Javascript codes management
*Add a new Javascript Code with these Items :
Title * : as you like
Placement :In the home page
*paste this code

Code:
$(document).ready( function() {
    var salemh = window.location.href;
    if (salemh === "http://www.duelmasters.org") {
    document.getElementById("left").style.display = 'none';
        document.getElementById("right").style.display = 'none';
}
       });

*than SUBMIT
avatar
Mr.SnOuP
New Member

Posts : 18
Reputation : 4
Language : En & Fr

http://en39.forum.st/forum

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by ELTP November 23rd 2017, 6:07 pm

Hi,
This didn't workout for me. Any other suggestions?
ELTP
ELTP
New Member

Male Posts : 18
Reputation : 2
Language : English and Finnish

http://duelmasters.foorumini.com

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by skouliki November 23rd 2017, 6:35 pm

skouliki
skouliki
Manager
Manager

Female Posts : 15397
Reputation : 1709
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by ELTP November 23rd 2017, 6:59 pm

I already tried that and it worked wonderdully on our phpBB3 based forum but not on our invision based forum.

That's why I am asking the code for INVISION here.
ELTP
ELTP
New Member

Male Posts : 18
Reputation : 2
Language : English and Finnish

http://duelmasters.foorumini.com

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by Van-Helsing November 23rd 2017, 11:44 pm

Hello,
Can you please post your forum's link?
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by SLGray November 23rd 2017, 11:46 pm



Displaying Widgets Only on Homepage Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51567
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Displaying Widgets Only on Homepage Empty Re: Displaying Widgets Only on Homepage

Post by Van-Helsing November 24th 2017, 12:13 am

Hello @ELTP,
Thanks @SLGray Smile,
Please go to ACP(Admin Control Panel) > Modules > HTML & JAVASCRIPT > Javascript codes management > Javascript Codes > Javascript Codes and create a new javascript:

Name: Disable Widgets
Placement: In all the pages

Javascript Code:
Code:
jQuery(document).ready(function(){
      if (location.pathname !== '/') {
      jQuery('.module .box-content').css('display','none');
      jQuery('#content').css('margin-right','0px');
      jQuery('#left').css('display','none');
      jQuery('#content').css('margin-left','0px');
      jQuery("div#main").css('width','1260px');
      }
});

Then press submit. You can adjust your forum width as you wish.

It will dynamically hide your widgets in all of the pages except your home page. Smile
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Back to top

- Similar topics

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