SimplePortal

Support => English Support => Topic started by: Krall on May 10, 2009, 08:53:51 PM

Title: Putting blocks on index page only?
Post by: Krall on May 10, 2009, 08:53:51 PM
Hello,

First, I just installed SP and it's already changed the look, feel and function of our website. Thanks for the great software! :)

Now, I tried searching around for this answer but can't seem to come up with anything. I also might be blind, but I couldn't locate a manual...

Anyway, we don't want to have a front page right now, so I set 'Portal Mode' to integration so you go right to the forums and see see the blocks we have setup. They look great on the index page, but they are a bit cumbersome to have on every page including when you're trying to type in a reply.

Is there anyway to set the blocks to only show on the index and not everywhere else in the forum?

Thanks for the help :)

Oh we're using SMF 1.1.8 and SP 2.2.1
Title: Re: Putting blocks on index page only?
Post by: Nathaniel on May 11, 2009, 01:52:14 AM
When you edit a specific block, check the 'Advanced Options' checkbox under the 'Display Options' section. You will then need to check the 'Forum' action.

You will have to repeat for each block.
Title: Re: Putting blocks on index page only?
Post by: Krall on May 11, 2009, 11:29:16 AM
Thanks Nathaniel,

I actually did that already and it didn't have the desired effects. Let's see if I can explain by example:

http://www.the-teh.com/forum/index.php?board=1.0 (http://www.the-teh.com/forum/index.php?board=1.0) - It shows up in the forum like that which is fine.

But when you enter a thread or hit reply like this:

http://www.the-teh.com/forum/index.php?topic=130.0 (http://www.the-teh.com/forum/index.php?topic=130.0) -thread

http://www.the-teh.com/forum/index.php?action=post;topic=130.0;num_replies=12 (http://www.the-teh.com/forum/index.php?action=post;topic=130.0;num_replies=12) -reply

All of the blocks still show up. I was hoping you wouldn't have too see all the blocks on the top and right side when you entered a thread and hit reply.

I guess what I'm looking for under advanced options/boards is a way to check 'index'. But I'm not sure that is possible.

Title: Re: Putting blocks on index page only?
Post by: Nathaniel on May 11, 2009, 05:33:22 PM
Do you have any other checkboxes ticked under "Advanced options"?

Having only the ''Forum' checkbox as the only option, should make it show just on your Boardindex page. :/
Title: Re: Putting blocks on index page only?
Post by: Eliana Tamerin on May 11, 2009, 06:46:13 PM
I'm pretty sure it doesn't. Forum covers the general non-Portal, standard actions (i.e. straight smf forum, no new feature mods).

See the following code, that's why:
Code: (Subs-SPortal(1-1/2).php) [Select]
// If we are on portal, show portal blocks; if we are on forum, show forum blocks.
elseif (($portal && (in_array('portal', $display) || in_array('sportal', $display))) || (!$portal && in_array('sforum', $display)))
return true;

In order to restrict it to the index only, why don't you try clicking Advanced Options, then typing in 'boardindex' in the text area. See if that'll work, since boardindex is a defined action in SMF.
Title: Re: Putting blocks on index page only?
Post by: Krall on May 12, 2009, 12:49:55 PM
Do you have any other checkboxes ticked under "Advanced options"?

Having only the ''Forum' checkbox as the only option, should make it show just on your Boardindex page. :/

Nope, nothing else checked.

For instance we have a 'recent post' block. I just checked that box for our 'A Gathering of Gamers!' forum. Now the only time you'll see the 'recent post' block is when you enter that forum; it won't show in any other.

I just ran through all the settings and with is set as 'forum' just checked it shows everywhere still.

I can pretty much do the inverse of what I want to accomplish and that's have the blocks show up everywhere EXCEPT the index :D

I'll just bite the bullet and figure out how to code in a 'forum' button for the various custom themes we have and then setup simple portal so we have an actual portal with blocks and a forum without them.
Title: Re: Putting blocks on index page only?
Post by: Krall on May 12, 2009, 12:57:34 PM
I'm pretty sure it doesn't. Forum covers the general non-Portal, standard actions (i.e. straight smf forum, no new feature mods).

See the following code, that's why:
Code: (Subs-SPortal(1-1/2).php) [Select]
// If we are on portal, show portal blocks; if we are on forum, show forum blocks.
elseif (($portal && (in_array('portal', $display) || in_array('sportal', $display))) || (!$portal && in_array('sforum', $display)))
return true;

In order to restrict it to the index only, why don't you try clicking Advanced Options, then typing in 'boardindex' in the text area. See if that'll work, since boardindex is a defined action in SMF.

One question first :)

When I check the advanced options box that overrides whatever you have selected on the drop down box 'Show Block On'?

Ok I tried your suggestion on the search block and it essentially removes that block from all pages (index, boards, posts) so that's a no go.

Title: Re: Putting blocks on index page only?
Post by: ???1031 on May 12, 2009, 04:12:32 PM
There are nice collapse button if you click on the advance option, you can select every position where the block should appear. So that it will appear again on Forum, Portal or any other action ;).
Title: Re: Putting blocks on index page only?
Post by: Eliana Tamerin on May 12, 2009, 04:27:17 PM
Except that the Forum action includes all subsequent "forum" actions. Boardindex, Messageindex, Display, Post, Search, and so forth. He wants to display the blocks only on boardindex.
Title: Re: Putting blocks on index page only?
Post by: ccbtimewiz on May 13, 2009, 06:24:11 PM
You're trying to get the boardindex to load with the blocks only? So you don't want blocks on any other page?

Perhaps this might do it for you...

Open index.php (the one located in the same folder as your Settings.php file.

Find:
Code: [Select]
// Action and board are both empty... SPortal!
if (empty($board) && empty($topic) && $modSettings['sp_portal_mode'] == 1)
{
require_once($sourcedir . '/SPortal1-1.php');
return 'SPortal';
}

Replace with:
Code: [Select]
// Action and board are both empty... SPortal!
if (empty($board) && empty($topic) && ($modSettings['sp_portal_mode'] == 1) && (@$_GET['action'] == ''))
{
require_once($sourcedir . '/SPortal1-1.php');
return 'SPortal';
}

That, in theory, should prevent the portal from showing on any page besides the main index.
Title: Re: Putting blocks on index page only?
Post by: [SiNaN] on May 16, 2009, 03:56:11 AM
^That wouldn't work. We already have Integration mode for this purpose.

----

Under normal conditions, simple display option "Forum" will show a block in every areas of forum. However, the advanced display option "Forum" will display block only on board index. This is a bug with Integration mode only.

Sources/Subs-SPortal1-1.php

Code: (Find) [Select]
// If current action or board is in display info; or we should display block in all actions or all boards then you can display block.
elseif ((!empty($action) && (in_array('allaction', $display) || in_array($action, $display))) || ((empty($action) || $action == 'forum' || in_array($action, $display)) && !empty($board) && (in_array('allboard', $display) || in_array($board, $display))))
return true;

Code: (Replace) [Select]
elseif (!empty($board) && (in_array('allboard', $display) || in_array($board, $display)))
return true;
elseif (!empty($action) && (in_array('allaction', $display) || in_array($action, $display)))
return true;
elseif (empty($action) && empty($board) && $modSettings['sp_portal_mode'] == 2 && in_array('forum', $display))
return true;

Your display options for the block should be set as in the attached screen shot.

----

Also, just to show the power of custom display options, such an option would make it show the block on board index only, in Integration mode.

Code: [Select]
all,-~action,-~board,-~topic
SimplePortal 2.3.8 © 2008-2024, SimplePortal