Integration with panels 2
Michelle - December 13, 2007 - 21:20
| Project: | Bio |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Michelle |
| Status: | closed |
Description
For Advanced Profile, I need to integrate bio with panels 2. This is best done by adding code to bio for panels to pick up. Attached is the .inc with the bulk of the code. I also need this line added to bio_init():
<?php
require_once drupal_get_path('module', 'bio') . '/bio_panels.inc';
?>I can make a patch for that when I don't have a wiggly baby on my lap.
Michelle
| Attachment | Size |
|---|---|
| bio_panels.inc_.txt | 1.03 KB |

#1
Oooh! Exciting!
I'll take a look at this a.s.a.p.
Should the require_once() line be wrapped in an
if (module_exists('panels')) {}??#2
I said this on IRC but, for completeness, yeah, that makes sense. The inc is the important part so however you think best to call it is fine.
Thanks for looking at this. :)
Michelle
#3
Just a quick note... if it's in a conditional, it has to be include_once, not require_once. require means require, regardless if that's in a control statement or not.
#4
I've been thinking more on this issue. I have no idea when or even if this will get into bio, which makes it difficult for advprofile users. Plus, I still need to write one for nodeprofile and then I've got the same problem of having to get it into the module. I've decided I'm just going to adapt this into a general user-to-node relationship handler and incorporate it into advprofile. You're still welcome to this patch if you want it, but you don't need to add it on my account.
Michelle
#5
I'm fine w/ adding it, but it needs reviews.
#6
Ok, I changed it to
<?phpif (module_exists('panels')) {
include_once drupal_get_path('module', 'bio') . '/bio_panels.inc';
}
?>
and it's working fine.
Michelle
#7
I sat down tonight to try and test this and get it in. Michelle patiently explained to me how to test this, but unfortunately it's not quite "clicking" with me (I'm tired, what can I say :P).
She said:
"Go to /admin/panels/panel-page/add. Create a panel page and give it a user ID for an argument on the contexts tab. Then choose node from user under relationship. Then under content, when you add content, you should have a node context."
Here's a patch version anyway... contains some minor updates for coding standards compliance and the like. If anyone here's a panels user and can lend some assistance testing this, I'd really appreciate it!
#8
EDIT AGAIN.
Redid the whole installation of cck (including patching) and bio and panels.
Deleted all the database entries done by bio, and removed all variables related to bio or advanced profile.
Now it works.
#9
Ok, I tried webchick's patch and it's working for me. Not sure what LasseP was seeing. If anyone else wants to give it a try:
Install bio, panels, and CCK (dev version)
Patch bio with webchick's patch (note: you and the patch need to be in the bio directory for it to work)
Add data to your bio node
Create a panel page
Set the URL of the panel to be user/%
On the "context" tab, choose user from the arguments drop down
On the same tab, choose "node from user" in the relationships drop down
Save and go to the "content" tab
Click the + to add content and you should see a section for "Node context"
Add node content
Save the panel
Go to user/UID and you should see the node content from the bio node
Or you can install the advanced profile module and see if it works. :)
Michelle
#10
Haven't made it too far with customizing things, but so far this is looking amazing. Followed the directions and it appears as if everything is showing up nice and smooth. Very impressed by this module. I will test it and see what kind of bugs I find. Thanks for such a great contribution and the tutorials made it a breeze!
#11
Ok, I interpret kyrtik and LasseP's edited comment as two +1s and thus an RTBC, so I went ahead and committed it to 5.x-1.x dev. Thanks, folks!! :)
#12
Automatically closed -- issue fixed for two weeks with no activity.