SimplePortal

Support => English Support => Topic started by: fl4pj4ck on November 02, 2010, 12:41:30 PM

Title: exclude certain pages
Post by: fl4pj4ck on November 02, 2010, 12:41:30 PM
is it possible to exclude certain pages from displaying the blocks?
I have over 10 blocks on the site, and adding more content/pages now and then and really don't have patience to modify every block every time I make a change

ideally, I would like a field in SP panel to list the pages that have to be skipped - maybe there's a mod for this?

if not - can you tell me how to exclude pages by altering SP code?

thanks!
Title: Re: exclude certain pages
Post by: AngelinaBelle on November 02, 2010, 01:28:15 PM
A "blocks on this page" listing that you can use when editing a page to show and alter blocks on/off on the page would be very convenient for users. I would definitely enjoy a mod or feature like that. It could represent a significant coding effort, and would take a while. Maybe somebody will work on something like that some day. I have not heard of concrete plans for something like that so far.
 
In the meantime, it sounds like you are adding lots of custom SimplePortal pages to your website, and find it tedious to run through your entire blocks list every time you add a new page.
 
Maybe there is some blocks display option strategy you can use to cut down on this somewhat.
Have you used the advanced display options? You could use the check boxes to be very specific about where you want blocks to show up.
 
This would be pretty tedious the first time through your blocks list. But, after that initial investment of effort, each time you added a new SimplePortal page, it should not be on the list of pages checked for that block.
 
This is the kind of approach I take. It causes me less work than any other approach I can think of.
Do you think this would work for your forum?
Title: Re: exclude certain pages
Post by: ccbtimewiz on November 02, 2010, 01:49:32 PM
From the looks of it, it is entirely possible by doing a few manual hacks to how SP deals with specific actions.

There is already a layer of prevention in SP to show blocks, it is used in the configuration to disable in admin/forum/profile/pm etc. You could manually hack this area to include page actions, and then perhaps do a query to make a toggle list of boxes.

In short: you can mod it to make it much easier. And it's a fairly simple mod to make.
Title: Re: exclude certain pages
Post by: fl4pj4ck on November 02, 2010, 02:07:10 PM
thanks Chris, that's what I'm currently trying to do
Title: Re: exclude certain pages
Post by: AngelinaBelle on November 02, 2010, 07:30:45 PM
All that stuff is checked in function getShowInfo in Subs-Portal.php
You can see where display and display_custom stuff is done.
So you could just hardcode something there, I suppose.
 
Anything else would be more involved.  It would involve the kind of logic you see in function sportal_admin_block_edit, because you would want, every time you created a page, to edit a bunch of blocks to tell them not to show up on the page.
 
If it is not already intuitively obvious to you how to do that, it will be an involved process to figure it out. It is not intuitively obvious to me. It may be much more obvious to ccbtimewiz -- I know he has done a lot of work on a competing mod.
SimplePortal 2.3.8 © 2008-2024, SimplePortal