hello, i want to show forum widget ONLY in home page. can i do it? thanks anyway
3 posters
Forum Widget Only Show in Home Page
kumotta- Forumember
- Posts : 203
Reputation : 3
Language : English
- Post n°1
Forum Widget Only Show in Home Page
Ange Tuteur- Forumaster
- Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania
kumotta- Forumember
- Posts : 203
Reputation : 3
Language : English
i use punBB version
Ange Tuteur- Forumaster
- Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania
Add this to your stylesheet :
Display > Colors > CSS stylesheet
and this to your homepage message :
Display > Generalities
Display > Colors > CSS stylesheet
- Code:
#right { display:none }
#content-container div#content { margin-right:0 }
and this to your homepage message :
Display > Generalities
- Code:
<style type="text/css">#right { display:block }
#content-container div#content { margin-right:183px }</style>
kumotta- Forumember
- Posts : 203
Reputation : 3
Language : English
it's work, but i have border there... how to hide it?
Ange Tuteur- Forumaster
- Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania
Add this to your stylesheet to hide the homepage message :
- Code:
#pun-announcement { display:none }
kumotta- Forumember
- Posts : 203
Reputation : 3
Language : English
it's work, but that's way make mess my homepage.
do you have alternative way to use javascript?
Mad Scientist- New Member
- Posts : 18
Reputation : 2
Language : English
Hello @kumotta,
I will use Ange Tueur's CSS codes assuming they work as intended in punBB forum. So, after using his 1st part of CSS code in your CSS stylesheet, your widgets are hidden from all pages. To unhide it just for homepage you can use something like this:
I did not test it out, but the concept is there. Try and tell me how it went. If it doesn't work, please give me the URL of your forum too (I suspect the one that is in your profile is not the same forum as the one in screenshots you have provided here).
P.S. Put the code in Modules -> Javascript Management and tick only at homepage.
I will use Ange Tueur's CSS codes assuming they work as intended in punBB forum. So, after using his 1st part of CSS code in your CSS stylesheet, your widgets are hidden from all pages. To unhide it just for homepage you can use something like this:
- Code:
$(document).ready(function() {
if ($(location).attr('href') == "URL_of_your_forum_homepage_goes_here") {
$('#right').css('display','block');
$('#content-container div#content').css('margin-right','183px');
}
});
I did not test it out, but the concept is there. Try and tell me how it went. If it doesn't work, please give me the URL of your forum too (I suspect the one that is in your profile is not the same forum as the one in screenshots you have provided here).
P.S. Put the code in Modules -> Javascript Management and tick only at homepage.
Ange Tuteur- Forumaster
- Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania
Try increasing the right margin in the homepage message.
I can't exactly give you a surefire code since you haven't provided your forum URL.
- Code:
<style type="text/css">#right { display:block }
#content-container div#content { margin-right:183px }</style>
I can't exactly give you a surefire code since you haven't provided your forum URL.