Former Member
inherit
guest@proboards.com
206080
0
May 11, 2024 10:22:40 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 28, 2014 8:11:42 GMT -8
Hi everyone, I wonder how to only show the shoutbox on the main page. I don't want to see it while navigating threads/sub-boards or any other menu than the main page. How can I do this? I tried some stuff with '<!-- $[shoutbox] -->' but that did not seem to change anything. Website for reference: theengineerlegion.boards.net/Thanks in advance!
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Feb 28, 2014 12:08:23 GMT -8
Hey @wolfineer, I moved your thread to the Templates board since to accomplish this, you'll need to modify your layout templates.
It's pretty simple to get the shoutbox to only appear on the home page - just go to Admin > Themes > Layout Templates > Forum Wrapper and locate the $[shoutbox] variable in that template. Copy and delete it, and then save that template so it's removed from the wrapper (which is loaded on every page).
Then, go back to Admin > Themes > Layout Templates but click on Home this time. Scrolling down towards the bottom of this template, paste the $[shoutbox] variable where you'd like it to appear. Since this template only affects the homepage, it will appear there alone.
|
|
Former Member
inherit
guest@proboards.com
206080
0
May 11, 2024 10:22:40 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 28, 2014 12:36:03 GMT -8
Hey @wolfineer, I moved your thread to the Templates board since to accomplish this, you'll need to modify your layout templates. It's pretty simple to get the shoutbox to only appear on the home page - just go to Admin > Themes > Layout Templates > Forum Wrapper and locate the $[shoutbox] variable in that template. Copy and delete it, and then save that template so it's removed from the wrapper (which is loaded on every page). Then, go back to Admin > Themes > Layout Templates but click on Home this time. Scrolling down towards the bottom of this template, paste the $[shoutbox] variable where you'd like it to appear. Since this template only affects the homepage, it will appear there alone. Thanks a lot, I got it to work nicely. Did not know it was that easy!
|
|
inherit
201190
0
May 30, 2015 3:16:42 GMT -8
Mr. Tom
163
October 2013
mrtom
|
Post by Mr. Tom on Mar 1, 2014 11:56:02 GMT -8
Is it possible to do this but for a custom page, so the shout box is only on the custom page? Thanks, Mr. Tom
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Mar 1, 2014 11:59:59 GMT -8
It's possible, Mr. Tom, but it's not as easy as the instructions above. You'd need to place the shoutbox variable back into the Forum Wrapper template (so it appears on all pages again instead of the home page) then add in an If statement that checks whether or not you're on the custom page in question.
|
|
inherit
201190
0
May 30, 2015 3:16:42 GMT -8
Mr. Tom
163
October 2013
mrtom
|
Post by Mr. Tom on Mar 1, 2014 12:01:02 GMT -8
Ok, and what code exactly do I need to put in?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Mar 1, 2014 12:15:56 GMT -8
First, reverse my instructions above (if you've followed them), taking $[shoutbox] out of the homepage template and placing it back to its original position in the Forum Wrapper template, under the $[content] variable, Mr. Tom. If you're starting fresh, though, the variable should already be in the right place and you shouldn't need to do that. Then, highlight the $[shoutbox] variable in the Forum Wrapper and paste over it with this. {if $[route.params.page_id] == "YOUR CUSTOM PAGE ID"} $[shoutbox] {/if}
You'll need to edit the bolded part to match whatever ID you provided when creating the custom page.
|
|
inherit
208704
0
Jul 26, 2014 11:44:46 GMT -8
scootermac
4
May 2014
scootermac
|
Post by scootermac on May 15, 2014 19:46:11 GMT -8
Hi David,
I am having a problem creating the shoutbox on my custom page as well. I pasted the PHP code under the content but can't get it to show up on my page. I also made sure that the shoutbox is enabled under the forum settings.
$[content] {if $[route.params.page_id] == "testid"} $[shoutbox] {/if}
http://drunkdivision.com/page/testid
Does the custom page need to include the $[shoutbox] var and will it still work with custom domains?
Thanks
|
|