TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,245
  • Total Topics: 21,354
  • Online today: 565
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 164
  • Total: 165
  • @rjen

Show on all except frontpage?

Started by Resident Geek, April 17, 2007, 04:50:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Resident Geek


I want some of my blocks to show on every page EXCEPT the frontpage.
I know that this has been asked before, and I know that the answer is that it can't be done, but I think it can, and here is how.

If I can get the base code for all of the blocks that I have, and place them into a php block, and run an if statement like the following:

//Are we on the frontpage now?
if ($url == 'http://www.yoursite.com/forum/index.php')
{
//If so then don't display the block

}
else
{

//If not then display the block
--The block's code--
}


This should work should it not?
All I need is to know where the code for the blocks is. Once I have this info, I should be able to run this through the block and exclude it from being visible on certain pages.

Where is the PHP code for the blocks?

Lesmond

You can set what to show on the front page, by going to admin/tp settings/Front page settings
there you can choose what you want from the options

Resident Geek

I know that. What I want is exactly opposite. I want to be able to choose what NOT to show on the front page. There are also some situations were I don't want a specific block to show up in a certain page of the website.
If I can just have the code for the built in blocks now...
*Rubs hand together eagerly* ;D

Zetan

You can already specify which blocks to display in any part of the site you want.
I have some centre blocks to display only in my FAQs board.

What you can't currently do is, turn Off left/right panels in the forum and then decide that you want a few left blocks in say the FAQs board.
I have left/right panels to display only on the home page. I can't use a left block in the FAQs because it's disabled from being shown in the forums.

This may be changed sometime.

Resident Geek

I'm saying that I want to have, say the user block, to show up in the forum AND in the FAQ AND in the profile screen but NOWHERE else. (I'm not yelling or anything. Just emphasizing. ;D)

This could only be done if I had a separate block showing up in each individual section.
I don't want to have to do this.
If someone could kindly direct me to the code, then I should be able to do this relatively easily with the code up top.

Zetan

I understand exactly what you are saying and I did from the start, and I agree, I have wanted this myself at times.

If you don't ask, you wont get  ;)

No idea  :2funny:

IchBin

I've posted some code for this a few times. While TP doesn't have these options built in (yet), you can put some code in a block to only display on certain pages. Search my posts and you'll find it.

Resident Geek

I'm not finding it Ichbin. I've done multiple searches but can't find where the code for the preset blocks are at. Maybe you could direct me?
(I know you have a lot of posts and this is probably a big request, but I can't seem to find it anywhere...)

IchBin

if (isset($_GET['board']) && $_GET['board'] == 4){
echo 'all_your_stuff_here';
}


Change the #4 to what ever board you want.

If you don't want it to appear in just a board you can change board to topic and put the topic number instead of the board number.

bloc

The blocks are fetched and laid out in TPortal.php. Its a loop with the permission check inside it, so you need to look at how its fetching them and do some changes there.

Whats missing from block layout options is a switch from showing a block on a specific page, to NOT show a block in a specific page - which is why this option is already added for TP 1.0.

I believe this was suggested by IchBin a while back lol :) if memory serves me right.

This website is proudly hosted on Crocweb Cloud Website Hosting.