Some confusing terms there, but that's exactly what I'd like to do.

I have two content types, "Project" and "Meeting." We schedule several meetings for each project. The Project node is displayed as a panels variant and shows a bunch of important information about the project. (These are mostly a bunch of views I've compiled). What I'd like to do is show the "Create Meeting Form" as a Pane in the Project Variant as well. This way you can schedule meetings without leaving the project main page.

I could theoretically imagine doing this by clicking an option to add as content the page at path: node/add/meeting.
Then use a panel variant for THAT page to make the form more compact.

But in looking through the "add content" options I don't see an ability to do anything like that. I see that I can show completed nodes, but I don't see where I can show other pages that aren't nodes.

So, is it possible to add a page as panel content?

The next step, of course, is can I configure contexts and relationships to automatically determine the values of certain cck fields in the meeting creation form?

Thanks!

Comments

merlinofchaos’s picture

Status: Active » Fixed

In order to do this, you'd need to either create a custom type with the PHP filter or write a content type plugin that displays the form you want. Writing content type plugins isn't difficult, but the node form is prety special so may have difficulties. I'm not actually sure.

mehoo462’s picture

That sounds like a project for another time and place. I'm a bit of a newb.

(If anybody wants to work on such a thing, I'd be thrilled to use it on my site!) :)

Thanks for the quick response!

merlinofchaos’s picture

I believe killes has managed to use a node add form in a Panel. Maybe he'd be willing to share some code.

mehoo462’s picture

Can anybody help with this? I'm a bit of a newb, but this would make the difference between my site being pretty good and quite awesome.

eclipsegc’s picture

@mehoo462:

So there are a couple of ways you can accomplish this. To actually do what you're wanting to do, you can pass a node form context to the panel. It will want to know what type of node form context you want to pass, just tell it meeting and then you'll have a whole slew of form items in the content type selector widget w/i panels to help do this with. The issue here is that you don't want to have multiple forms in the same panel (i.e. don't try to add a project and meeting node form context to the same panel and try to get both forms on a single page).

The other options (and one I advocate significantly) is to actually co-locate your administration on a menu tab w/ the page you're looking at. For example, you may be a my/path, you would move the panel at my/path to my/path/view as a default menu tab, and then add my/path/add_meeting as a regular tab through the context_admin module (plugs into page manager the same as panels). This would allow you to then have a more robust dashboard w/ administration tabs as necessary. Context_admin can also set node references automatically by the path you're at if you like, so if the project page is node/%node/view (which it is) then you could add a node/%node/add_meeting tab to that, and have the node reference for it auto-filled out by context admin.

I'd be happy to help you out with this, I'm on IRC all the time, just hit up the #drupal channel if you end up going this direction.

EclipseGc

mehoo462’s picture

This is fantastic. I will play with this and see what I come up with. I'll hit you up in IRC if i run into problems.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mehoo462’s picture

Eclipse this is great. It took me a little while to wrap my head around it, but basically we're putting a "create node of type x" form at any path we'd like. This gives us more flexibility with our our navigation.

Perfect!

mehoo462’s picture

Status: Closed (fixed) » Active

Okay, small problem now: How do I get the tabs to only show up on one specific node type (the project node).

Now they are showing up on every node of every type.

So if you're not looking at a node of type: project, and the default tab (view project) you get a "page not found" error. Because the selection rules for the page at that path say to only display the page if %node= type: project.

I think this is tricky because menu settings apply to pages with concrete URLs while selection rules only apply to variants. So even though the variant only shows up when viewing project nodes, anytime it sees //node/%node as the URL it recognizes that as a the parent of a menu tab system and shows me the tabs.

I tried displacing the system by one level (changing the path from //node/%node/project to //node/%node/project/mainview) such that //node/%node/project would be the menu parent instead of //node/%node. This way selection rules would make sure that the menu parent would only exist when looking at a node of type "project." But that didn't have any affect at all. I don't really understand why.

Can anybody assist? This is more a question of how menu tab works with the pages system then panels or Context Admin.

Thanks!

merlinofchaos’s picture

Status: Active » Fixed

Pages have a higher level 'access' tab which works just like selection rules but controls the visibility of menu items such as tabs.

mehoo462’s picture

Thanks merlin! Now another problem...

When I create a page at address //node/%node/project
then set "access" to "Node:type is type project"
then set the page as a default menu tab with the parent menu item as "normal menu item" or "menu tab"

I get "access denied" on all my nodes, regardless of type (include the project type).

If I set the parent menu item to "already exists" my nodes show up properly. The tabs for my context admin pages show up properly as well (only on the project node type as set in access), but the default tab is missing. Which means if you click on one of the other tabs, you can't navigate back to the initial node view.

I don't understand why this is happening. But I'm not entirely confident I understand how how menu tabs work.

Any assistance would be greatly appreciated.

EDIT: I access most of my nodes by clicking on links in views. I just noticed that clicking on a link in a view takes me to //node/%node. Not //node/%node/project when looking at project nodes. When i manually type in //node/%node/project (making sure %node is indeed a project) I get access denied.

So it appears that the issue is with using access "Node:type is type project." When browsing to a project node, the page isn't kicking in and taking me to //node/%node/project with all my cool panels set up.

mehoo462’s picture

Status: Fixed » Active

changing status to active.

mehoo462’s picture

Status: Active » Fixed

There was a typo causing some of the strange behavior noted above. I have things working in a way that makes sense, but the behavior is still undesirable. This has to do with the way Pages and Menu Tabs interact with //node/%node. It's a seperate issue. I've posted it here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.