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,217
  • Total Topics: 21,351
  • Online today: 556
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Display block only on specific article category

Started by HugiN, March 07, 2011, 03:11:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

standarddamage

Quote from: IchBin on March 14, 2011, 09:21:42 PM
When trying to show a block only in a category, do you have the category options set to display the panel that the block is in? I just tried this and didn't have a problem.

Actually, I'm running into the exact same problem on my site...

dcexpendables.com
SMF 2.0 RC5, TP 1.0 RC1

When you go to the main page, you see the Photo Gallery block in the upper panel. The should also appear in the upper block of the Photo Gallery (see the menu option on the right), but for whatever reason it simply won't show.  I've done a lot of experimentation with this, and what I've found interesting is that this only happens when you want to display a block in the Upper panel in a Category.  Some other things that might help you...


       
  • Yes I've triple checked the settings.  All of the Categories are set to show the Upper Panel, and the blocks are set to show in the Categories.
  • I've tried this in five different themes, and always get the same result.
  • It doesn't matter what type of block is in the Upper Panel (html, php, preset blocks, etc); you will always get the same result.
  • The Upper Panel will show in everything else: Forums, Front Page, Individual Articles, etc. Categories are the only place this problem occurs.
I appreciate how busy you are, so I tried to narrow this down as far as I could. If you have a solution to this problem, I would greatly appreciate it as it's limiting a couple of things we need to do with the site. Right now my TP installation is set to show the Photo Gallery on both the front page and the Photo Gallery category.

IchBin

Please test this to see if it works for you. You may have to go back in and re-save the block and categories that you are trying to use to get the settings to save properly.

Open Sources/TPortalAdmin.php file:
Code (find about line# 1022) Select
$check = array('layout','catlayout','toppanel','bottompanel','leftpanel','rightpanel','upperpanel','lowerpanel','showchild');

Code (replace) Select
$check = array('layout','catlayout','toppanel','bottompanel','leftpanel','rightpanel','centerpanel','lowerpanel','showchild');


Open Themes/default/TPortalAdmin.template.php:
Code (find about line: 1743) Select
<td><input type="checkbox" name="tp_category_upperrpanel" value="1"' , !empty($mg['upperpanel']) ? ' checked="checked"' : '' ,' />', $txt['tp-displayupperpanel'] ,'</td>
Code (replace) Select
<td><input type="checkbox" name="tp_category_centerpanel" value="1"' , !empty($mg['centerpanel']) ? ' checked="checked"' : '' ,' />', $txt['tp-displayupperpanel'] ,'</td>

Let me know if the upperpanel works for you. Please also test to make sure the upper block display normally outside of categories and other places. Thanks.

standarddamage

Quote from: IchBinâ,,¢ on March 22, 2011, 05:56:43 PM
Please test this to see if it works for you. You may have to go back in and re-save the block and categories that you are trying to use to get the settings to save properly...

Ichbin -

First off, I owe you a massive apology.  Due to some circumstances beyond my control, I've been away for a few months and unable to address this.  Thank you for your reply to my issue.

I tried exactly what you suggested, but it doesn't work. It still won't show under a specific category.  I even tried re-creating the block completely after applying the fix, but to no avail.

Any other thoughts?  Could it simply be the theme I'm using?  I'm aware not everyone is having this problem.

IchBin

No problem damage. It Looks like right and left blocks work. Upper blocks aren't working. Sorry I didn't see that sooner. I've fixed a few bugs with related situations. Let me check if my latest code has the same problem. If so I'll see if I can't figure out why it's working that way.

IchBin

Open Themes/default/TPortalAdmin.template.php and change this on about line #1743
<td><input type="checkbox" name="tp_category_upperpanel" value="1"' , !empty($mg['upperpanel']) ? ' checked="checked"' : '' ,' />', $txt['tp-displayupperpanel'] ,'</td>

Replace with this:
<td><input type="checkbox" name="tp_category_centerpanel" value="1"' , !empty($mg['centerpanel']) ? ' checked="checked"' : '' ,' />', $txt['tp-displayupperpanel'] ,'</td>

Go back in and resave the article options to display the upperpanel and it should be good to go I think.

This website is proudly hosted on Crocweb Cloud Website Hosting.