We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Fixed Announcement Code
Topic Started: Dec 31 2014, 01:29 PM (297 Views)
Alrauhne
Member
[ * ]
I'm looking for a code, if any, to anchor an announcement box on the front /index page of my forum. People are complaining it follows them to every page and we're trying to find a way to keep it only on the front page of the site.

Subsequently, is there a way to make it to where it shows up on only certain skins?
Offline Profile Goto Top
 
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
Try this
Themes > Themes > Theme Layout
Code:
 

<div class="indexonly">
<div class="category">
<table class="cat_head">
<tr>
<td>
<h2>Announcement</h2>
</td>
</tr>
</table>
<table>
<tr>
<td>CONTENT HERE</td>
</tr>
<table>
<tr>
<td>CONTENT #2 HERE</td>
</tr>
<table>
<tr>
<td> CONTENT #3 HERE</td>
</tr>
</Table>
</div>
</div>
<script>
if(!location.href.match('/index')){document.write('<style>.indexonly\{display:none;\}</style>');}
</script>


Make sure to add this to the theme layout of each theme you want it to show for.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
If you have lots of themes and don't want to go through the repetitive process of adding the theme to every Theme Layout you want to apply the announcement box to, you can instead use a JavaScript method by having the announcement code located in the Board Template only.
Offline Profile Goto Top
 
Alrauhne
Member
[ * ]
I'm not familiar with Javascript unfortunately.


Edit: I did try the code in the skin themes and it's working out nicely, thank you very much <3
Edited by Alrauhne, Jan 3 2015, 11:56 AM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It sounds like you don't need it, but if you were to need it I would code the JavaScript code for you.
Offline Profile Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Could place what Kankuro posted in the board templates; i.e "Above the Board" and it will do the same thing with minimal effort.
Offline Profile Goto Top
 
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
Viral
Jan 10 2015, 09:29 PM
Could place what Kankuro posted in the board templates; i.e "Above the Board" and it will do the same thing with minimal effort.
He only wanted it to show on certain themes though. That's why I said Theme Layout
Offline Profile Goto Top
 
Helena
Member Avatar
M is for Mod

Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic