Closed (fixed)
Project:
Panels
Version:
5.x-2.0-beta5
Component:
Plugins - content types
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2008 at 15:19 UTC
Updated:
12 Jan 2009 at 15:50 UTC
I get how to use the blocks, but I would like to put certain forums, or threads into a panel. Any ideas on how to do this?
Comments
Comment #1
jeff h commentedYou can put forum nodes into a panel very nicely... create a node override panel (url will be node/%) and give it a node id context. Tick each content type you wish to override.
Putting other parts of the forum system (eg forum listings) into a panel is not so easy. Doable, using code (I can provide you with some sample code if you know your way around template.php) but without a bit of your own PHP I am not aware of a way to do this right now.
Comment #2
iaminawe commentedI have been wanting to put the forums listings page and the user blog listing page into a panel too.
I have searched around quite a bit for a solution to this so if you have code that you could share to help achieve this I would be most appreciative.
Thanks
Comment #3
jeff h commentedOK, the code isn't without compromises; to the best of my knowledge, your panel won't have access to contexts, for example.
Firstly, read through the info at http://drupal.org/node/232644. Basically my only modification to that code is to switch the value of the 'DEFAULT' depending on the current page's path.
In the _phptemplate_variables function in your theme's template.php, put the following code:
Hope I got that all right (I'm pulling a fair bit of site-specific stuff out of the above code). Let me know how you go!
Jeff
Comment #4
surge919 commentedthis is what my _phptemplate_variables function looks like:
I get the following error when I run it..
Parse error: parse error, unexpected T_CASE in /var/www/html/php/drupal-5.7/themes/ability/template.php on line 42
Any ideas?
thanks.
Comment #5
iaminawe commentedhavent had a chance to apply this yet but will report back with results when I do.
Comment #6
sdboyer commentedThe proposed code ought not have any effect on your panel's access to contexts.
FYI, this is now the fourth issue where someone has referenced http://drupal.org/node/232644 as a reason that a) they went down a path that gave them more problems with panels, not less, or b) they got really confused about what panels does and doesn't do. I just don't have time to take care of documentation stuff like that right now, but I'm getting to the point where I almost just want to delete it. If nothing else, it does a _really_ great job of muddying the nomenclature even further.
@OP: 'certain' forums or threads may be a little difficult. They'd have to be differentiated based on taxonomy ID or something like that, so that you can tell panels_page to only panelize nodes with certain tids.
Panelizing all forums, though, is much more just a matter of picking a node ID context and ticking the right boxes, as pointed out in #1.
The title replacement issue is just plain complicated and ugly right now, although we've got a fix in that hopefully evens things out for RC1.
Comment #7
iaminawe commentedI get the same T_Case Error when I run the above code so it does not work for me yet either.
I noticed though that I cant seem to get the example at http://drupal.org/node/232644 to work any more either.
My template does not have the $op = 'page' in it and if I place it within the _phptemplate_variables that is being declared I notice no visible difference.
@sdboyer - so is this method a dead end to replace the main forums and faq page? It seemed to work once and well and then never again. This is a really great thing to be able to do with panels.
Has anyone done this before with the drupal forums?
Maybe I just need to theme my main forums page to look like my panels page?
The node override works great for individual forum threads.
Comment #8
sunYou should learn PHP. See http://de.php.net/manual/de/control-structures.switch.php
Comment #9
socialnicheguru commentedsubscribing