3

Call me stupid, but I currently have a site that is using both Joomla and Drupal (long story). The site uses a number of sub-domains to represent different geographic locations.

For the main menu in Drupal, I have some items linking to pages within Joomla. However, Drupal doesn't allow to to specify a relative URL if the link is external to Drupal. This means I have to put the full URL including http scheme and hostname. Consequently, clicking these menu items results in a new window or tab being opened up, which is not what I want!

Does anybody know of a way I can have Drupal accept an external URL without needing to include the domain? For example: "/myJoomlaURL", instead of "http://www.mydomain.com/myJoomlaURL"?

Currently using Drupal 6.

0

I think you have in drupal to make a hook_menu to declare all your new page that you need and you can use drupal_goto function in the call back function to redirect it to your page :)

about target blnk You can use http://drupal.org/project/menu_attributes to add new attribute to menu like target

  • Thanks Ahmed, I think I follow you here (I'm not yet strong on Drupal module development) so will give it a go, and also take a look at that module. – John Rix Mar 29 '12 at 22:15
0

Links opening in new window have nothing to do with the URL, relative or not, but with the target attribute of the <a> tag.

  • Countzero, I understand that, but Drupal is controlling this, presumably on the basis of me having to define a full URL to link to Joomla pages on my site. I have no control over the target attribute of the menu items. – John Rix Mar 29 '12 at 22:06
  • You could for example use the Menu Attributes module to take control of that. – Countzero Mar 30 '12 at 7:20
0

If your worry is to open subdomain target in the same window (to avoid a new window) then the simple solution is to use a extrnal link module, https://www.drupal.org/project/extlink, It will allow you in its configuration to specify regular expression to treat as external link (to be opened in new window) or internal link (not to be opened in new window.) For example: you can include your subdomain in configuration option: "Exclude links matching the pattern" like "http://www.mydomain/myJoomlaURL". and the links will be opened in same window. But if your concern is "an external URL without needing to include the domain", then me too looking for an answer till now global variables in settings.php is the thing the closest i got.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.