Hi I have a site that uses i18 module and is important to create paths with names as en/panelname
but when i append a / character in the path name, the panel created no longer works.
I will appreciate your help, i am running 4.7.3.

Jose

CommentFileSizeAuthor
#8 i18n_panels.patch576 bytesmathieu

Comments

merlinofchaos’s picture

So I suppose saying to enter your urls as:

en/panelname

And not

en/panelname/

isn't what you're looking for?

andespeople’s picture

Title: Panels not working with / character. » I tried with en/panelname/ but still doesn't work

Thanks for responding, the link below takes you to my panels in which you get to see the panel en/panelname/ created:

Admin panels

but when you go to the actual page where it should be seen, the page not found message shows up:

Panel: en/panelname

I am using "panelname" as the path to the primary link "Home" in the frontpage of my site. When you switch between languages, i18 automatically appends en/ or es/ to links, so it is supposed to take it to the panel en/panelname, or that is what i thought.
Hope it is a little more clear,

Jose.

merlinofchaos’s picture

Thanks for the demo, now I understand what's really going on.

The 'en' and 'es' isn't really part of the URL, I think i18n is making it part of the base_url (i.e, what Drupal thinks is the site name).

So I set the URL to just 'panelname' and that works. Which leaves you in the position of being unable to easily create multiple panels for each language. I'm not sure how i18n wants to deal with that in cases like this. It probably has no idea how to do that, but I am not sure. I've never really dealt with i18n issues.

andespeople’s picture

Title: I tried with en/panelname/ but still doesn't work » Possible solutions?

Forgive my lack of technical knowledge, but i thought this was a panels module issue since i got nodes working fine with en/ type of sufixes in the path.

merlinofchaos’s picture

Title: Possible solutions? » Panels and i18n integration

No worries. This still leaves an issue with how to translate panels, which I will leave active in the hopes that someone who knows i18n can discuss solutions.

dreamlusion’s picture

Panels is a container so one logic path says that its up to the contained nodes/block/etc to have translations.

Using the following panels_content_node in node.inc, you can force the Panels module to display a nodes translation if available

function panels_content_node($conf) {
  global $locale;
  // Load the translated node, if exists.
  $nid = module_invoke('translation', 'node_nid', $conf['nid'], $locale);
  if ($nid)
    $conf['nid'] = $nid;
  $node = node_load($conf['nid']);
  if (!node_access('view', $node)) {
    return;
  }

  if ($conf['suppress_title']) { 
    $node->title = ''; 
  }

  $output = node_view($node, $conf['teaser'], FALSE, $conf['links']);
  return $output;
}
mathieu’s picture

subscribing

mathieu’s picture

Version: 4.7.x-1.0 » 5.x-2.0-alpha7
Status: Active » Needs work
StatusFileSize
new576 bytes

Here's a patch, made against panels 5.x-2.0-alpha7, based on the code sent by Jorgito_el_loco. This is clearly not optimal, but it's a starting point...

omar’s picture

After applying this patch and editing a node all of the english items in my primary links menu were duplicated. The french menu items were not duplicated and thus the primary links still appear correctly. Note that I was working in the english interface when this took place.

omar’s picture

... I should note that to fix the links (manually) one has to disable and re-enable each link.

Note also to be able to "switch languages" using panels, *I think* one will have to use a single language for all link paths/aliases. :-(

e.g.

example.org/en/myalias and example.org/fr/myalias
instead of
example.org/en/myalias and example.org/fr/monalias.

Otherwise *I think* that one would have to create additional aliases manually map requests from one alias language to the other as the actual menu item for the panel can only have one entry.

merlinofchaos’s picture

Status: Needs work » Active

I've committed simple support to translate nodes via translation module. No idea if this works as I don't have translation.module installed! Let's see what else we can do in the next version.

Leaving this active as I'm sure there needs to be more.

mathieu’s picture

There was a check in the patch to make sure that $nid wasn't null in case the translation doesn't exists.. which got lost on the way.

In panels/content_types/node.inc, line 38, here is a new version that fixes that :

$_nid = module_invoke('translation', 'node_nid', $nid, $GLOBALS['locale']);
if ($_nid) $nid = $_nid;

Thanks,

merlinofchaos’s picture

Status: Active » Fixed

Checked in a fix. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)
wundo’s picture

Version: 5.x-2.0-alpha7 » 6.x-2.0-alpha2
Status: Closed (fixed) » Active

It seems to be happening again with Drupal 6 and Panels 6.x-2.0-alpha2, anyone confirms?

s.daniel’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.0-alpha3

Yes this issue is still open. Language neutral nodes can be loaded in a pane nodes with language information don't display.
Nodes with language information can be added as a pane but they won't display.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Panels 2 is no longer available and is unsupported. Marking all Panels 2 issues won't fix.