Page 1 of 1

Menu: different link (URL) per language?

Posted: Fri Oct 26, 2007 4:32 pm
by andrewvanmarle
I have a menu item linking to an external site, can I have different URL's per language so the menu points to the right translatin of the external site?

Re: Menu: different link (URL) per language?

Posted: Sat Oct 27, 2007 6:14 am
by infograf768
I solved this issue by modifying the file
administrator/components/com_joomfish/contentelements/menu.xml

I have added a line which lets change the url when the menu item is translated (in red below):

For joomfish 1.8

  Menus
  A. Kempkens
  1.8
  Definition for the core menu manager
 
 
  ID
  Name
  params
  Menu Type
  Link URL
  Check out by
  Check out date
  c.published >= 0
 
 
 
    name
    menutype
    published
 
For joomfish 1.7

  Menus
  A. Kempkens
  1.7
  Definition for the core menu manager
 
 
  ID
  Name
                Link URL
  Check out by
  Check out date
  c.published >= 0
 
 
 
    name
    menutype
 

Re: SOLVED: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 8:59 am
by andrewvanmarle
wow, thanks!!!

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 9:11 am
by andrewvanmarle
I added the line of code, but I  don't see a change in the translation screen.  did I do something wrong?

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 10:46 am
by infograf768
Don't know as I can't see.
The line adds a new part in the link-url translation page

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 12:22 pm
by andrewvanmarle
hmm, ok, I added the code, correct location, and then went to joomfish>translations and chose menu's and the laguage. clicking a nemu item didn't show me an extra field.  Am I supposed to find it there?

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 3:06 pm
by infograf768
Yep. See picture.

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 3:36 pm
by andrewvanmarle
hmmm, how strange!

I think I Am doing someting wrong since I turned off another type (params) and it didn't make a difference either.

Re: Menu: different link (URL) per language?

Posted: Mon Oct 29, 2007 3:43 pm
by andrewvanmarle
ok, it gets stranger and stranger, since I tried to make joomfish react to anything, so I changed the screen name of and that did nothing. is there a cache?

Re: Menu: different link (URL) per language?

Posted: Thu Jan 10, 2008 6:38 pm
by g0nz0
your workaround for JoomFish 1.7 works perfectly for me, thanks a lot!

:D

Re: Menu: different link (URL) per language?

Posted: Tue Mar 18, 2008 2:12 pm
by dzhao
:( Dear,

I have one smae problem?

I do't know what exactly I should write in XML file

<field type="titletext" name="name" translate="1">Link URL</field>

Correct?

Thanks

Re: Menu: different link (URL) per language?

Posted: Tue Mar 18, 2008 3:42 pm
by infograf768

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<joomfish type="contentelement">
  <name>Menus</name>
  <author>A. Kempkens</author>
  <version>1.8</version>
  <description>Definition for the core menu manager</description>
  <reference>
  	<table name="menu">
  		<field type="referenceid" name="id" translate="0">ID</field>
  		<field type="titletext" name="name" translate="1">Name</field>
  		<field type="params" name="params" translate="1">params</field>
  		<field type="text" name="type" translate="0">Menu Type</field>
  		<field type="text" name="link" translate="1">Link URL</field>
  		<field type="checked_out_by" name="checked_out" translate="0">Check out by</field>
  		<field type="checked_out_date" name="checked_out_time" translate="0">Check out date</field>
  		<filter>c.published >= 0</filter>
  	</table>
  </reference>
  <translationfilters>
  	  <keyword>name</keyword>
  	  <menutype>menutype</menutype>
  	  <published>published</published>
  </translationfilters>
 </joomfish>

Re: Menu: different link (URL) per language?

Posted: Tue Mar 18, 2008 3:59 pm
by dzhao
Dear,

I am using 1.7, also I copy

<field type="text" name="link" translate="1">Link URL</field>

only, and it is working well.

Many thanks

Dong

Re: Menu: different link (URL) per language?

Posted: Sun Mar 23, 2008 8:46 pm
by kebdana
Hello,
I had the same problem, I solved it with the new xml file (thanks),
But I've got an other problem the field where I've to translate my link is too small compare to my long link.
Is there a solution to that?
many thanks all...

Re: Menu: different link (URL) per language?

Posted: Wed May 14, 2008 10:16 am
by Kampp
I was told in Joomfish forum that this would not work. Does it work - is it that simple?
Do we know if this fix workes for Joomfish 2.0 and Joomla 1.5?

Related thread: http://forum.joomla.org/viewtopic.php?f ... u#p1226648

Re: Menu: different link (URL) per language?

Posted: Mon May 19, 2008 8:02 am
by Rocco
It works but long url's can't be inserted at the field , can that be changed?

Re: Menu: different link (URL) per language?

Posted: Thu Feb 19, 2009 11:29 am
by brunoazevedo
HI Rocco,

In menu.xml, try to insert

maxlength="300"

like:
<field type="text" name="link" maxlength="300" translate="1">Link URL</field>

Working to me. :pop

I Now this answer is to late, but can help someone.

Thanks!

Re: Menu: different link (URL) per language?

Posted: Thu Feb 19, 2009 12:42 pm
by akede
Hi,

Are you testing the long URL's on 2.0 or 1.8?

Alex

Re: Menu: different link (URL) per language?

Posted: Thu Feb 19, 2009 2:33 pm
by brunoazevedo
Hi Alex,

I tested with Version 1.8.2. ( Joomla 1.0.15 )

In the Version V2.0.2 (Joomla 1.5.9), work, but it need some change in the menu.xml element:

You need change in line 13:

<field type="readonlytext" name="link" maxlength="300" translate="1" posthandler="saveUrlParams">Link</field>

TO:
<field type="text" name="link" maxlength="300" translate="1" posthandler="saveUrlParams">Link</field>

Summary:
Change the type="readonlytext" to type="text"

NOTE: I'm not a PHP expert, so i can't explain why this are read only.


Bruno

Re: Menu: different link (URL) per language?

Posted: Fri Feb 20, 2009 11:45 am
by akede
Hi Bruno,

I'm very happy to see that you as non PHP expert figured out these changes. Honest this says for me that the decision of using a XML file instead of other configurations is the right one.

Yes your changes work right. There is a feedback idea (http://feedback.joomfish.net/pages/gene ... and-simple) that goes into your direction as well. The reason why this is related is that the link in the menu normally is generated automatically. If you translate it manually this can cause problems with the translations if you change the original.

I hope this helps everybody.

Alex