SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75!  2
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

String: URL path in panelizer

3 years 8 months ago #125639 by carogray
String: URL path in panelizer was created by carogray
We have a multilingual website using entity translation in Drupal 7.

We are using panelizer to display pages.

I can add blocks to the panelizer and the visibility rules for languages works and even string:URL path now works if I just put in the exact page URL, but if I want to the block to appear on all pages with a path that includes the URL, it is not working.

For example I have a block for an emergency get help now that I want to appear only on domestic violence pages. So I have put the domestic-violence/* into the visibililty rules show on pages box, and the block appears on all pages. IF I just put domestic-violence, the block appears only the one page whose URL is exactly domestic-violence.

Am I missing syntax? I am assuming this condition should go in Panelizer visibility rules, not in the restricted pages section of the block itself?

Also we would like to translate the get help now blocks and have the translations appear on their corresponding language pages. This seems to work, the language visibility rules work, we just seem to be struggling with the URL conditions.

Thanks,
Caroline

Please Log in to join the conversation.

3 years 8 months ago #125650 by Daniel Pickering
Replied by Daniel Pickering on topic String: URL path in panelizer
Hi Caroline

I haven't used panelizer but reading how it works I would still expect it to be set on the page block visibility rather than panelizer. URL & Translation get really complicated have you tried creating url aliases for it?

Thanks
Daniel

Please Log in to join the conversation.

3 years 8 months ago #125653 by carogray
Replied by carogray on topic String: URL path in panelizer
sorry creating URL alias for .."it"?

which "it"? do you mean.

the answer is in fact YES we have URL aliases for everything.

the block has a URL alias and the pages on which we want the block to appear have URL aliases
and we are using the Panelizer Visibility Settings to set the conditions for which languages the blocks appear on - successfully. It is only the string:URL path that is not working.

I have tried setting the restricted pages on the block itself too, but this does not work either.

I am looking in a number of places for help on this, I will let you know if and what I find if I can find a solution

Thanks,
Caroline

Please Log in to join the conversation.

3 years 8 months ago #125654 by Daniel Pickering
Replied by Daniel Pickering on topic String: URL path in panelizer
Hi Caroline,

have you considered internationalization ?
www.drupal.org/project/i18n

The documentation is rather detailed.
www.drupal.org/node/1279392

Thanks
Daniel

Please Log in to join the conversation.

3 years 8 months ago #125662 by carogray
Replied by carogray on topic String: URL path in panelizer
installed and enabled and using
thanks.
Caroline

Please Log in to join the conversation.

3 years 8 months ago #125668 by Daniel Pickering
Replied by Daniel Pickering on topic String: URL path in panelizer
Great Caroline let us know if we can help with anything else.

Thanks
Daniel

Please Log in to join the conversation.

3 years 8 months ago #125670 by carogray
Replied by carogray on topic String: URL path in panelizer
those modules are installed, enabled and we are using them, but I didn't say "working"

I am not sure they are the issue.

I think I need help from someone who has experience both with Panelizer and multilingual Drupal 7.

But thanks for trying.

C

Please Log in to join the conversation.

3 years 8 months ago #125674 by Daniel Pickering
Replied by Daniel Pickering on topic String: URL path in panelizer
Sorry Caroline I took your comment to mean you had made progress. Here are some things to consider with the site.

Here are three possible solutions. All of them assume you have i18n Internationalization module drupal.org/project/i18n installed and configured to provide content translation with PATH PREFIX or DOMAIN negotiation enabled.

Make sure panel content type is translatable.
1
Navigate to CONTENT MANAGEMENT -> CONTENT TYPES -> EDIT PANEL
Set MULTILINGUAL OPTIONS to "Normal - All enabled languages will be allowed."
Navigate to you panel edit page SITE BUILDING -> PANELS, select a page to edit
Go to the LAYOUT tab
Click the edit icon for a block and select STYLE -> CHANGE
Set the style to SYSTEM BLOCK
Go to the block edit page SITE BUILDING -> BLOCKS
CONFIGURE a block that is being used in the Panel page
Set MULTILINGUAL SETTINGS to "All languages (translatable)"
Make sure you have translated the block content

Have blocks for specific languages
2
Navigate to CONTENT MANAGEMENT -> CONTENT TYPES -> EDIT PANEL
Set MULTILINGUAL OPTIONS to "Normal - All enabled languages will be allowed."
Navigate to you panel edit page SITE BUILDING -> PANELS, select a page to edit
Go to the LAYOUT tab
Create a block for each language in the same are of the layout. Set a visibility setting based on USER LANGUAGE.

Code block to detect language using PHP input. Need PHP knowledge to implement.
3
Navigate to CONTENT MANAGEMENT -> CONTENT TYPES -> EDIT PANEL
Set MULTILINGUAL OPTIONS to "Normal - All enabled languages will be allowed."
Go to the block edit page SITE BUILDING -> BLOCKS
CONFIGURE a block that is being used in the Panel page
Set MULTILINGUAL SETTINGS to "All languages (translatable)"
Using the PHP input format add language detection and create a case condition for all the langauges.
<?php
global $language;
switch ($language->language) {
case "es":
?>
Spanish HTML code
<?php
break;
case "en":
default:
?>
English and Default HTML code
<?php
break;
};
?>

Thanks
Daniel

Please Log in to join the conversation.

3 years 8 months ago #125679 by carogray
Replied by carogray on topic String: URL path in panelizer
All righty,
now we're cookin' with gas.

Will try and get back to you.

Thanks,
Caroline

Please Log in to join the conversation.

3 years 8 months ago #125735 by Valentin
Replied by Valentin on topic String: URL path in panelizer
Hi Caroline,
Wonderful!

Let us know if we can help you in something else

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!