Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Voodoo Tech and Scripter's Den of Scriptniquity > Hide Widgets When Not Viewing Forum Groups
Mottie (MVP) 7/17/2011 7:46 AM EST : Hide Widgets When Not Viewing Forum Groups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hide Widgets When Not Viewing Forum Groups

Simple and basic, this code hides the named widgets when you are viewing any forum topics, subforums or posts.

Code

The following code is in the Customizable Code tab of the Mod.
<script>$(function(){$.hideNonForumZones({

// When viewing forum topics, this will hide side content zones, when true
topicsHideSides : true,

// When viewing forum topics, this will hide all widgets in the same column as the forums, when true
topicsHideSameColumnWidgets : true,

// When viewing a forum post, this will hide side content zones, when true
postsHideSides : true,

// When viewing a forum post, this will hide all widgets in the same column as the forums, when true
postsHideSameColumnWidgets : true,

// Enter the Title of the widget to hide. The title must exactly match the widget title - capitals & spaces
widgetTitlesToHide : ""

});});</script>
Customizing
  • Note: This mod is compatible with the "Toggle view of side content" mod.
  • When you first open the Forums page, you are looking at the Forum Groups view.
  • After selecting a forum or subforum in the Groups view, you'll see the Topics view.

    • Set the "topicsHideSides" option to true to completely hide the side zones in the topics view. Set to false to not do it.
    • Set the "topicsHideSameColumnWidgets" option to true to hide all other widgets within the same zone as the forum widget while in this topics view.

  • From the Topics view, clicking on any post will put the forums into the Post view.

    • Set the "postsHideSides" option to true to completely hide the side zones in the post view. Set to false to not do it.
    • Set the "postsHideSameColumnWidgets" option to true to hide all other widgets within the same zone as the forum widget while in this post view.

  • The "widgetTitlesToHide" option allow you to enter the title of the widget(s) to hide

    • These widgets are hidden when the forums are not in the Groups view, i.e. it is applied to both the Topics and Post views.
    • To include more than one widget, separate the titles with a comma.
    • The titles are case sensitive and will only match the widget title text, so "News" will hide the "Guild News" & "Site News" widgets, but not "news". 
    • Example use:

      widgetTitlesToHide : "Who's Online, Guild Information, Contacts"

    • Please note that even though this mod is compatible with the "Toggle view of side content" mod, hiding widgets using this option will not restore their visibility when toggling the side content.

Edit (1/6/2012): Changed instructions to match the mod options.

TopBottom

Valdaglerion (Guild Admin) 1/4/2012 11:42 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
Valdaglerion
Posts: 2473
Zomgawsh Poster

I love this and do use it to hide our shoutbox when viewing forums or messages.  I am having some problems that I'm hoping you can help with.  Frist, or forums page has three columns.  I'd like to hide the widgets in the side columns when viewing messages.  I can do this with the existing code but the space occupied by the side columns is still there.  What I want is for someone reading a post to have the side columns disappear AND the center column to expand to take up the space.  This is similar to the mod you created to allow folks to hide the side columns (expanding the center column) but I want it done automatically like the script above.

Second, I'd like the option to only have the widgets disappear when viewing posts not posts AND forums.

Thanks Mottie!
TopBottom

Mottie (MVP) 1/6/2012 5:26 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Val!

I've converted this into a mod with a bunch of options... see the updated post above. Hopefully it'll get approved today, or we'll have to wait until next week.

Enjoy!
TopBottom

Aaron Lewis (Blue Collar) 1/6/2012 5:43 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
GuildPortal Dev
Aaron Lewis
Posts: 1979
Zomgawsh Poster

Approved. 
Aaron Lewis, GuildPortal.com
TopBottom

Valdaglerion (Guild Admin) 1/6/2012 6:00 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
Valdaglerion
Posts: 2473
Zomgawsh Poster

Works great except...


I'm viewing a post (so no side columns).  When I click to reply to the post, the side columns return.  They should remain gone.
TopBottom

Mottie (MVP) 1/6/2012 6:42 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Ok, all fixed, no need to update your mod, but you may have to use shift + browser reload button once or twice to make sure the browser cache has been updated.

And thanks Aaron!!
TopBottom

pinstripesc (New Admin) 1/24/2012 5:00 AM EST : RE: Hide Widgets When Not Viewing Forum Groups
pinstripesc
Posts: 4895
Zomgawsh Poster

Hey hey,

I'm trying to get our Vent info ("SC Vent") to disappear when viewing forums but it doesn't want to. I set everything else as false. The below just does nothing?


<script>$(function(){$.hideNonForumZones({
 
// When viewing forum topics, this will hide side content zones, when true
topicsHideSides : false,
 
// When viewing forum topics, this will hide all widgets in the same column as the forums, when true
topicsHideSameColumnWidgets : false,
 
// When viewing a forum post, this will hide side content zones, when true
postsHideSides : false,
 
// When viewing a forum post, this will hide all widgets in the same column as the forums, when true
postsHideSameColumnWidgets : false,
 
// Enter the Title of the widget to hide. The title must exactly match the widget title - capitals & spaces
widgetTitlesToHide : "SC Vent"
 
});});</script>
TopBottom

Mottie (MVP) 1/24/2012 7:35 AM EST : RE: Hide Widgets When Not Viewing Forum Groups
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi pinstripesc!

Yeah sorry, the problem with the script is that is must match the title exactly! I think there is an extra space after the title, so try including that: "SC Vent "

Nevermind! You're not even using this mod! The SC Vent widget has the widget access level mod applied and I see this code in the footer HTML to hide the shout box:
if (window.location.href.match('ForumID')) {
 $('.gpWidget-shout').hide();
}
Edit #2: I've updated the code to make it target both "ContentBoxTitle" and "ContentBoxTitleNoBackground". No need to update the mod.
TopBottom

pinstripesc (New Admin) 1/24/2012 11:41 PM EST : RE: Hide Widgets When Not Viewing Forum Groups
pinstripesc
Posts: 4895
Zomgawsh Poster

Yeah I disabled/enabled the mod a few times and wondered if that and the custom javascript were conflicting.

EDIT: nice, got it - thanks!
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%