I need the ability to have a page on the top half of the layout and a view on the bottom half. The view translates perfectly fine. But the node doesn't. I am not certain where to start. I am willing to code, but I haven't had to do any major development in drupal yet. I started to look at the views to see how the functions are called but it wasn't clear to me.

If someone could give me a verbal design I will work on writing the code. Unfortunately I don't know where to begin.

CommentFileSizeAuthor
#11 block_16.patch1000 bytesrhys

Comments

hass’s picture

ups... not tested this yet, but i need Panels module too.

Roberto Gerola’s picture

Never used Panels module.
I'll need to install it and understand how it works.

pearcec’s picture

According to the API.txt the same guy who wrote Views wrote Panels. You can add your own content types. We could add one called localizer, and then do the appropriate calls to localizer to load the correct node. It would be hackish in my opinion.

Roberto Gerola’s picture

I've taken a look.

In content_types/node.inc of panels module, row 18 :
$node = node_load($conf['nid']);
Here we should act.

I'm just figuring out how to make it works in a clean way, meanwhile,
changing the function in this manner, seems to work.

/**
 * Output function for the 'node' content type. Outputs a node
 * based on the module and delta supplied in the configuration.
 */
function panels_content_node($conf) {
  $localized_nid = localizernode_get_localizednid($conf['nid'], localizer_get_defaultcontentlocale());
  $node = node_load($localized_nid);
  $output = node_view($node, $conf['teaser'], FALSE, $conf['links']);
  return $output;
}

I have tried to make the same thing in the node_api hook, for $op='load',
but it is very very dangerous.

Let me know.

pearcec’s picture

This works as expected. So should we talk to the author of Panels to figure out how we can play nice together? I always like to integrate and avoid excess patching that gets blown away if you have to update a module to do security purposes or otherwise.

Roberto Gerola’s picture

> So should we talk to the author of Panels to figure out how we can play nice together?
Yes.
I'll take a look also how the others content types are treated by panels module, so
we can make a proposal of a unique solution for all contents.
Implementation of some hooks, perhaps.

>I always like to integrate and avoid excess patching
Me too.

summit’s picture

Hi,

I am using the panels module, category module and would really like to use the Localizer module.
I am using drupal 4.7.6
Is above proposed solution also valuable for drupal 4.7.6?

The Panels author has the similar approach as you I think, so please get this rocking together.
Also for Drupal 4.7.6

Greetings,
Martijn

summit’s picture

Hi,

I would like to have the same option on panels as there is on nodes.
My panels are pages with blocks. If I select another language the whole panel should be translated like with nodes?
So I need to be able to select different blocks, views, etc..
I am using drupal 4.7.6 can you help me?

greetings,
Martijn

summit’s picture

Hi,

Above solution doesn't work for me.
I need the whole panel translated, like nodes.
If you click on a different language, the panel, the blocks inside the panel all should be changed in the new language.

Thanks in advance,
greetings,
Martijn

sun’s picture

Category: task » feature
rhys’s picture

StatusFileSize
new1000 bytes

I was having trouble with blocks not being viewed on the correct language, while viewing a panel.
I've only tested this on a small non-complex panel, but it seems to work.
The patch applies to panels/content_types/block.inc.

summit’s picture

Hi,

Does your patch also work for taxonomy-block blocks?
I will try it anyway! thanks.
greetings,
Martijn

hass’s picture

Status: Active » Closed (won't fix)