I am using Joomla 2.5 with the Language-Switcher Module and Plugin to built an multilingual site.
The main problem is: switching the language always leads to the translated homepage, but not to the translated menu-item., so I ran into the problem to find all translations of an Menu item.
Based on the internal Structure, the Language-filter only filters the page items with suitable language settings. So each menu item, or link, or url is unique and it is not possible to define something like a 'root' menu item for every translated menu item. Is it possible to create a Plugin that inserts a new button in the menu-item-creation-form?
Greeting philipp
Got it Working! Searching for "translations" did not lead to proper results, instead searching for "associations" solved it. I found the answer while looking into code of the com_menus files where is written:
$associations = MenusHelper::getAssociations( $active->id );
That's all, I just needed to register the MenusHelper class via:
JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
Related
I need to make a connection between articles on different languages in Joomla, like in the menu manager. Can anybody tell me how to implement it and if it's possible without using additional plug-ins?
Update:
I already have a multilingual, but only for categories and I need configure it for articles.
There is an example below:
http://clip2net.com/s/6SElBt
Article for "Solar Energy" category and when I change the language I move to the description of this category in another language, but not in the same article.
http://clip2net.com/s/6SEkD1
How do I configure the language switching and stay on the same article?
Joomla 2.5 and later have core support for multilingual content. But there are some extra steps involved, in order to set it up properly.
There are plenty of tutorials out there: http://multilingual-joomla-demo.cloudaccess.net/multi-lingual-steps-by-steps.html
Briefly the process involves the following steps:
Enable and configure the core language plugins
Install the additional translation packs
Add the corresponding content languages
Prepare your categories structure to reflect your multilingual content. - Note that you will have a root category for all languages and then a root category for each language.
Set the main language for your homepage
Create the corresponding Menu Structure for all your languages
Start writing content for each language
Configure and Publish the Language Switcher module.
I think what you are looking for is menu items/article associations.
If the article you want to connect to another is linked to your site through a menu item, go to the menu item in question and see the association tab. There you can select what other menu item you want to connect it to.
You can also associate articles with each other by doing the same thing. Go to article manager->the article in question->association tab and choose what article you would like to link it to.
With Joomla 2.5 you can associate menu items, but not individual articles. So the best you can do is if a menu item links to a specic article, then you link the articles at the menu level.
Joomla 3 has more options, and you can indeed associate individual articles in different languages (at the article level) ... it works like a charm.
Good luck!
I've been trying to find a solution for the same issue on Joomla 2.5 but couldn't.
Today I found this link that describes how the solve the issue on Joomla 3.0:
http://www.slideshare.net/erictiggeler/creating-a-multilingual-site-in-joomla-joomla-3-beginners-guide-eric-tiggeler
I didn't try it yet but it looks like the feature is supported in Joomla 3.0.
I am developing a Joomla website based on K2 with a multilingual front end editing possibility. This all works nicely, except for one thing: previewing K2 items in another language than you are using to edit them.
For example:
When Joomla is set to Dutch, I can edit the English item without a problem. However, I cannot view this item directly without first selecting 'English' as language for the site, otherwise the direct link to the item doesn't work.
I managed to work around this by modifying the getData() function in the K2ModelItem, so that the language is not checked there anymore. However, Joomla is still set to Dutch, it is not a 'real' preview of what the item would look like.
Therefore, I am looking for a solution to temporarily switch the language of Joomla to the language of the item (English in this example) AND switch it back directly, to be able to continue editing in Dutch after viewing the preview. Do you think this is possible? What code would I need to implement this automatic switching?
Let me know if I need to provide more information. Maybe someone has an inventive solution, thanks.
[edit]
It seems that forcing the $lang parameter in the item URL does a good job, together with the modification in K2ModelItem I described. But this only works with SEF disabled. I'd like to hear if there are other suggestions.
I can't see any menu in the EN version of my drupal site with the following settings in my menu :
When I select french all is ok but when I select english, nothing appears (I have content in both menu indeed)
In the blocks section, I see the two menus disabled.
Thanks to help me :-)
I would suggest using menu block contrib module.
This module will allow you to treat your menus as blocks.
Create 2 blocks (1 for each menu), and in block administration page you can specify the language for each block.
As there are usually several ways to reach a goal with drupal here is a proposal for a work around:
Create two menus with no language settings.
Try to put all menu items as neutral language so they show
up in both languages. (test that)
Assign the menus as blocks to the right region.
Then use the i18n module to control the language specific
display at the block level instead of the menu or menu item level. (Note you need the i18n_block module to do that which is part of the i18n module)
If you need aditional settings for the blocks see the allready mentioned menu block module.
Also make sure you check the internationalisation documentation.
I find that having two menus is always easier for multilingual websites.
I also prefer to use different views pages for different languages so I don't run into problems. That way I can add the path to the corresponding menu easily. Whenever I have tried to combine multilingual views and menus I have faced numerous problems.
In the screenshot you included I can see you have two menus.
First of all, I find it easier to name and title the menus according to their language because it's easy to get confused otherwise i.e. Main Menu English - main_menu_en.
Secondly, your french menu probably works because it's printed by your theme which is configured to render the main menu links in the specific region. To get your English menu to work you'll have to either:
a) add the required code in your theme, or
b) remove the code for the main menu in your theme and use 2 menu blocks placed in the desired region via the block admin page. In the block settings for each block you can select which language they'll be displayed for.
As the others said, you'll need: menu_block
If you need help with adding or removing the menu from your theme, please tell us which theme you are using.
There is a Seven Steps to achieve :
Step 1: Enable all modules
Content Translation (core module)
Locale (core module)
Internationalization
Variable
optional:
Language Icons
Translation Overview
Step 2: Add a language
Go to Configuration > Regional and Language > Languages
The default language is English, and you can use the “Add Language” link to add either Predefined or custom languages.
Step 3: Detection and Selection
For this tutorial I’ve chosen to use the “URL Prefix” setting. This tells Drupal to use domain.com/es for Spanish and domain.com/de for German.
Step 4: Enable Multilingual Support for content types
Either create or edit an existing Content Type and click “Publishing Options”. Here you will see the option for enabling multilingual support. Select “Enabled, with translation. This will allow you to translate a node into multiple languages.
Step 5: Create English Content
When you create your nodes, make sure you are using the correct language, not just “Language neutral”. This is important because when you create the URL alias and Menu link title it will know which menu to put the link in.
Once you’ve created your node you should see a “translate” tab. If you click this tab you’ll be able to add a translation to this node.
Note that if you have the “Translation Overview” module installed (I highly suggest it) you’ll get a nice little window that tells you which languages you’ve added, which require priority, etc.
Step 6: Created the translated content
When you create your translation give it a translated menu link title, but give it the same url alias as the original node. Because you have multilingual support installed, it won’t give you any errors for having the same URL alias (remember, it’s putting the Spanish nodes at domain.com/es and the German nodes at domain.com/de).
Step 7: Add support for multilingual menus
Go to Structure > Menus > Main Menu. Edit the menu and enable the “Translate and Localize” option. This will switch your menu items depending on what language the user has selected site-wide.
You’ll see you have both the English menu items and the Spanish items. You can order these like you wish, but know that only the Spanish links will show up when Spanish is selected as the main menu (you’ll know because the URL will say domain.com/es).
And your final product: In front end you can see it action .
Also you can use i18n_menu_navigation_links function.
I am working in Joomla 1.5 and have an article that I don't want listed in any of my menus. It is a special promotional page that exclusive people will be given the link to. Is there a way to give the article a pretty URL?
Currently the URL that works is /index.php?option=com_content&view=article&id=35. I would like that to be /15k.
Anyone help me?
I have seen this question, but the URL isn't quite what I'm looking for.
To get that URL you will need Joomla!'s SEF/SEO settings turned on (I'm assuming you've already got that setup).
In Joomla you have to create a new menu, call it something like "Utility Menu" but don't give it a "Module Title" - you don't want to display this menu so you don't need the module.
Then create a "Single Article" menu item with the alias 15k as a menu item within the "Utility Menu". You should now be able to access the article at the http://www.yoursite.com/15k
If you want to link to this from another menu create a menu item alias and point it at the 15k menu item. If you want to link from within an article simply point the link to the 15k menu item.
[Edit]
Routing in Joomla! first looks through the user defined paths (i.e. menu's and their menu items) then if it can't find a match for the requested resource that way it asks the particular component to build the route and if the components router is basic (i.e. nearly every single one in Joomla! 1.5) then you get the ?option=com_somecomponent&id=X style result. In 2.5 this is much improved but still uses the same routing mechanism.
I have created a simple basic component in joomla named, careerform so I want to know that what will be its url? Will it be :
index.php/?option=com_careerform
or in sef it will be something like:
index.php/components/careerform
or it will be like this while using .htaccess
/careerform
Is it true or what are joomla default URLs with different settings? Please tell what you know.
thanks for your time.
While what you are asking to do is possible, it would be rather complicated to rename a component. As part of the renaming you would have to update the names of dozens if not hundreds of classes throughout every file of the component. Very likely to run into some bugs because of this.
The far easier prospect is to just avoid these types of urls in your site. Joomla will only fall back to that style of url if a menu item does not exist for the view. Because of that, you can make the url into this:
http://sitename.com/any-component-alias/
To do this, go into the menu manager and create a new menu item. If you don't want this as part of the main menu, you can create a new menu. (I typically have a menu called "Hidden" for menu items that I want aliased but don't actually link to throughout the site from a menu.) When creating the menu item, make sure the type matches the component and view. The alias will then be whatever is entered in the alias box just below the title.
The one issue you may run into with this is that a component may not have a menu type for a particular view. In that case, you you would need to add the necessary metadata.xml file to the view (which again would be much easier than renaming the component!). A good tutorial for that can be found here: http://docs.joomla.org/Adding_view_layout_configuration_parameters.
yes if SEF will be enabled then index.php/component/careerform will be used.
You can create custom URLs by developing a router for your component.
There is very good documentation for it here.