How to link article on different languages - php

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.

Related

Joomla custom component customizations

I needed a component for specific catalog, so I've paid for it to one freelancer. As it turned out, he's not very good at his job and I was given a component that works only partly. The biggest issues are router, breadcrumbs and json array for parent categories.
1. Router
currently it shows only domain.com/menuitem/viewname?id=X. There are 4 different views that looks like are not connected at all. in db, every view has its own table as it was requested, important fields are as follows:
Main Categories (root):
id, name, alias
General Categories:
id, name, alias, root_id
General Subcategories:
id, name, alias, cat_id
Detail:
id, name, alias, subcat_id[json array]
What I would like to do is to make SEF urls to look like this: domain.com/menuitem/root_alias/category_alias/subcategory_alias/detail_alias but I was told that it can't be done this way. I checked the SEF documentation on joomla portal but I can't figure it out (if it's even possible and if not, what would be a good SEO approach).
2. Breadcrumbs
Maybe it's caused by router and separate views, but they always show Home > Menuitem, but in mainmenu it's only /alias while in breadcrumbs it's /alias/mainview. I found how to add custom breadcrumbs into pathway on joomla portal, but I can't figure out how to get parent items. If there was a solution with SQL I could use it would be enough.
3. JSON array in db
I would like to change it to integer value and add new table subcategory_detail_xref so I can find items easily. Only way I can do it now is by using regular expression in SQL which I don't think is a good idea. I've checked tutorials on joomla portal but it looks just too complicated.
Any ideas, links to examples or tutorials that can help or solutions are highly appreciated.
PS: My website is running on latest Joomla (3.5) so if there are solutions only available for 3.5+ it's fine, I don't have any plans to downgrade
For router source code, you can refer to com_content, it's similar yours, in the 3.5 version, the router has to implement an interface.
There is no detail document at Joomla Developer site, com_content is exactly what you can learn to get it.
The breadcrumb you have to develop similar of router logic
Category table should extend the JNestedTable for multiple level tree structure

Joomla 2.5 latest article from a category link

I would like to create a menu item with dynamic links to the latest article published in a given category.
I don't want to use the default category blog link because I want the link to leed straight to the article page and avoid duplicate content.
hope this is comprehensible, thx for helping me with this issue.
There are 2 ways to accomplish this, one with code, one without.
The no code method involves replacing the standard Joomla com_content with a CCK extension that has a latest item functionality built in - I know K2 has it for sure, there are likely others.
The other method would require you to create a new model/view/menu item that only pulls the latest published article. This would actually not be terribly difficult since you could basically copy most of the category model and use most of the article view to come up with what you need. The changes are a little too involved to post here however.

menu drupal in multilingual site

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.

Joomla article pretty url that's not tied to a menu

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.

Should I write a component or a module? (or both?)

I'm trying to write a slideshow for joomla. Specifically one that will be placed next to an article (no necessarily associated with the article though). Should i write a component, or a module? OR should I write a component that is placed in the page using a module (like the com_banner and mod_banner stuff in the joomla basic installation).
I know I am reinventing the wheel, but I really want to learn about joomla modding.
You want a module. You can assign modules to any menu items.
Modules will appear on that page and "sub-pages". For example, if you assign a module to a menu item that points to a "Article blog layout", then it will appear on that page and the articles linked from it.
If you only want one specific article, or any page without a specific menu item, create a new menu called "hidden menu" and make a menu item in it. Menus don't appear unless you publish the menu module.
By the way, there are many slideshow components for Joomla already out there - Photoslide from gavick.com is pretty good, and free.
If you want to associate the slideshow to a specific article i think you should write a component, because in this way you have more control on the article and you can manage its structure and its layout.

Categories