Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Exclude pages on new Panels (Admin > System Settings > Panels)

by ikandi, Last updated on 2 months ago in Content Administration - 9
Hello all,

I am adding some widget code for Public Comments and Ratings. I don't wish to use the in-built PHP-Fusion code for this purpose.

By adding the widget code into new panels, these can be seen on every page throughout the site. Great. But..

I wish to exclude the panels on certain pages and page types that don't need to see them (or more specifically, I don't want them to be seen on).

These include FAQ's and Forums mostly. I don't use News or Photos but assume others would.

Problem is, the exclude pages don't seem to work for sub-Forums such as:


I also need a method to allow the exclusion to cover a range of pages, such as:

infusions/articles/articles.php?cat_id= [EVERYTHING]

infusions/forum/viewthread.php?thread_id= [EVERYTHING]


Otherwise, I have to account for every new Article Category, FAQ entry and Forum entry as a separate excluded page, which is not very practical as this will require tedious manual entry in the mySQL Panels table.

Any assistance on this would be appreciated.

I s there a wildcard character that can be used at the tail of the code?
With this code, I am wondering whether the ampersand character is the offending culprit?

A specific widget or panel? Widget refers to the custom page widget (module), it only runs on Custom Page.

Panel refers to the site wide column elements, which can be excluded on Settings Panel Exclusion List.

Which one are we looking at here? :D

Screenshots in elaborating your problem will be good to help us help you. You can use Snippet Tool in windows. The image upload in this site without problem.

If you are using panels, in Admin Panel > Main Settings, there are panel exclusion list for pages.


I'm responding because we might be looking at an issue here which I would need to increment. Panel exclusions have not been extensively tested as they are copied from V.7.0.3, but we have a method that you can close down the entire panel columns built into 9.

In your theme.php, you can do a custom rule.

File: whatever-theme/theme.php

 $panels = \PHPFusion\Panels::getInstance();
 const PANEL_LEFT = 1;
 const PANEL_U_CENTER = 2;
 const PANEL_L_CENTER = 3;
 const PANEL_RIGHT = 4;
 const PANEL_AU_CENTER = 5;
 const PANEL_BL_CENTER = 6;
 const PANEL_USER1 = 7;
 const PANEL_USER2 = 8;
 const PANEL_USER3 = 9;
 const PANEL_USER4 = 10;

But that being said, you are only looking to exclude on certain pages, the panel exclusion list is only made to exclude panels on 1=1 url match. i.e. forum_id=16 and not [EVERYTHING], so I am afraid that wild card is not supported at the moment. I will need to increment this or at least double check it. If it's not available, I think an ampersand GET value of * should mean everything, possibly do a regex match.

I will get back to this thread.
Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
Thank you Chan, I will do some more investigating this week, on the various things you've pointed out above.
Ok, getting back to this thread, an example I can give is the following.

1) I have a Disqus Comments account. I wish to use it on my site using Panels, but using it in two ways. I use Disqus Comments for Public/Guest use (rather than the inhouse Comments function which is used for Members only). Disqus also uses the ReCaptcha Authentication method which is safer when dealing with public commenters.
2) The first panel added would be 'Disqus1', which is the Div/Script code block. I ensure all double quote marks are made single quote marks.
3) I create a second panel 'Disqus2', something like this:

<script id='dsq-count-scr' src='//domain.disqus.com/count.js' async></script>

Where domain is the name of your Disqus account. This bit of code is what generates the Disqus UI on the web page, interacting with Disqus1.

4) I have placed this block in the Lower Center section of Admin>Panels, and it shows up on every site page, unless I have put an exclusion range, which I have done.

For the most part, this works really well, except in areas like Forums, Blogs, Custom Pages where I can't wild card these sections (like blog.php/*) so I have to exclude these on a one-to-one basis.

There are other non PHP-Fusion blocks I wish to add in future too, but administering these singularly is a pain. Not insurmountable if your site is small, but a pain nonetheless. Here are some examples of single page exclusions which work well:


Hopefully that clears things up.
Ok, that explains your situation.

Now, let's get into some variables from your end.

You mentioned that you wanted to exclude some pages in /infusions/blog.php

What are the implementations like? For example:

Show panel when URL is /infusions/blog.php?readmore=1,
Hide Panel when URL Is /infusions/blog.php?readmore more than 1
Show panel when URL is /infusions/blog.php but do not show when readmore exist.

This will give us the coding insights what we are lacking in respect of the panel management exclusion list.

Also please give me your PHP-Fusion version currently (9.00 stable release from Sourceforge link, or if you are using our Github versions are 9.02, 9.03 Andromeda , 9.04 Babylon ) which you are using? I need to know which file to work on.

Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
Hi Chan,

I am using the stable release 9.0.

Re: the exclusion pages. On the basis that any new panel by default shows up across all site pages, if I want to exclude panels from certain pages I have to go into the panel record and add in the exclusion. As written above, mostly it works well, though I find it easier going into mySQL panels table and adding in the excluded pages that way, rather than the GUI in the Admin section.

So the exclusions which are problematic are:

I have to manually hide /infusions/blog.php?readmore=1 and so on, but as the blog expands so too do the pages, and it would be time-consuming and inefficient to hide them manually one by one.

Blog Archive pages (year and month) are an issue too, as these create their own set of pages.


The Uncategorised category for Blogs doesn't work either, and that's probably due to the string that is used (&filter=false):


I have hidden this page ok.


However, we start striking issues with the viewthread.php pages, purely because there are so many threads, and these are dynamic, being generated by users on a daily basis. An example:


Most of my Forums are member only, so there is no point to show a public commenting panel like Disqus as the public can't see the Forums anyway.

Custom Pages
I only have a handful of these, so I just manually add panel exclusions for these pages.


It would be good to hide all of these, and if there is an instance where a panel is required on a custom page, then I would just add that back as an inclusion (show).

[b]Article Categories{/b]
Again, I manually hide panels from these. This is a critical area from me so I prefer to be all over it. But I would never say no to a bulk exclude option such as:


The same would apply to other Category areas such as News, Downloads, Photo Gallery etc. The ability to hide using a wild card would be very useful.

Hope that's enough to go on.
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: Chan, ikandi