Drupal Multilingual translating views Argument - drupal

I am working on a multi lingual site using i18n module in Drupal 6 Version.
I have created Taxonomy terms per langauge and created mapping for the two languages I am using.
Now i created a page view(URL collections/%) with taxonomy term as views argument, for listing the nodes related to that term id.
Now the problem is when I view the url collections/4 in English its listing all the nodes related to that term id .
But when I click on the language Switcher the url become fr/collections/4 instead of fr/collections/20 where 20 is the translated term id for term id 4.
Please help me in solving this issue.
Thanks in Advance.

You should add a filter for language as well! That will do the job!

Related

drupal 7 taxonomy term translation in user profile field i18n

Problem: in the user profile page taxonomy term United Kingdom is displaying only in default language but not translating.
I have vocabulary Countries that has "Localize" option.
I've translated all the terms. For example: United Kingdom = Vereinigtes Königreich = Royaume-Uni = Великобритания.
I've made a menu Countries - so in language versions menu items are displaying translated and ok!
But in the user profile page Field Country is displaying only in default language and not translating if I go to lang versions.
The labels are displaying translated so I have Country, Land, Pays, Страна - labels. But the term United Kingdom is displaying only in english.
I am using Internationalization i18n, Taxonomy translation, Field Translation, String translation, Multilingual select modules.
here I have two methods language selection /admin/config/regional/language/configure : url and by default.
/admin/config/regional/i18n/select here i have checked both Select nodes by language Select taxonomy terms by language
I've tried to use Entity Translation but it is very big and difficult and not that I need.
May be there is User translation module?
Please what should I do to translate terms in user profile fields drupal 7?
You can always pass your variable trough t() function in your template, where you are printing it out and it will become translatable. It's work-around, but it can save time and nerves.
Trying to use Profile2 and Profile2 Translation modules and using field Country in Main profile (Profile2) I've solved this problem.
But Profile2 is not useful for me cause it makes new page in user editing page and lot of users have already set up field Country I do not whant to work with database.
If I knew I was using Profile2 + Profile2 Translation first!
May be you give recommendations how to get it with Profile module?

Drupal - Taxonomy page (show all terms of vocabulary)

I am kind of new to drupal (version 7).
I have taxonomy vocabulary with terms.
Example structure:
Taxonomy vocabulary: Address list
Terms:
Address 1
Address 2
Address 3
How can i create page with all these terms for this taxonomy vocabulary? Even if term is not associated with any of content?
Basically i need an page, that collects all terms from Taxonomy vocabulary called Address list and shows all terms that are created for this taxonomy vocabulary.
I know in drupal there are always many ways how to create things. I need most simple, without hardcoding.
I don't need full solution - any good road/idea/advice.
Thank you.
Install Views module. Add new view & select Taxonomy terms of Type Address list.

Displaying content of term reference instead of link (Drupal 7)

I need help with this Drupal 7 situation:
I'm publishing travel agency offers using my own content type named "offer"
I'm storing information about hotels (descriptions, prices, photos, etc.) in taxonomy named "hotel"
I need to display relevant hotel info in each offer
And here is my problem. I've added a new term reference field named "field_hotel", but I only get a link to taxonomy term instead of actual content.
I tried to use this code, entity_load() runs fine, but I get "EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids()" error in field_view_field(().
$term = entity_load('taxonomy_term', array($hotel["und"][0]["taxonomy_term"]->tid));
$view = field_view_field('taxonomy_term', $term, 'field_hotel');
print render($view);
What am I doing wrong?
Thank you for your answers
Instead of storing hotel information in taxonomy terms, I'd suggest that you create a separate content type for hotels. That way, you'll be able to link offers to hotels using References, which is a much more flexible approach. That will also allow you to display hotel information on the offer page using Views.
Try replacing the second line with $view = taxonomy_term_view($term);
See documentation for taxonomy_term_view.

Create a Drupal view that loads all articles that share any one taxonomy term (Contextual Filters)

I have a custom article type that contains a list of taxonomy terms
For example articles can be tagged with a location and possibly multiple topics.
On any given article's display page I would like to be able to pull a single view that gives a list of other articles that share any of of the taxonomy terms.
If an article was tagged with the topics of recipes & chicken as well as the location of new york I would like my single view to present the five most recent articles that share any one of the above tags.
The taxonomy terms have been added to the articles in the form of new fields of either the "Term reference" or "Node Reference" type. (field_topic, field_location)
I know that I have to somehow use a Contextual Filter, but I am having some trouble figuring out how to set and debug my "default argument".
I suspect that I've got to choose:
Taxonomy term ID from URL
Load the default filter from the node page
Do something with PHP code
I'm really struggling to get this displaying anything, and I can't even see a way to debug to find out what the values I'm getting are.
Can anyone help figure this out? Even some guidance on the right direction to look would be welcome at this point.
You can do this in just clicks if you have Drupal 7 and Views 3 (You already have this I'm sure).
Your configuration is correct so far.
Choose " Provide default value " as action to take if arg is not given.
Choose Term ID from URL"
Check "Load default filter from node page, that's good for related taxonomy blocks"
:)
this will load term IDs from the current node's term reference field if arguments are not given.

Multiple input fields in table

Currently we are migrating our intranet from plone 2.5 to drupal 7. Everything works out pretty well except one problem we are facing with the cck module.
In plone we had one content type "application" which allowed our members to applicate for a specific project. There were many input fields for describing the required qualification from other projects like in the following "image".
project description
[ ][ ] + - up down
[ ][ ] + - up down
[ ][ ] + - up down
add new row
Our member had the possibility to mention an unlimited number of projects and associated descriptions.
So the problem is, i´m unable to do anything similiar in drupal 7.
I could definitely add an unlimited node reference field and an unlimited text field, but there would not be any kind of relationship between the two fields and the user would have to click "add another entry" twice.
Another option would be the use of the module http://drupal.org/project/tablefield but its not possible to use the first column as a node reference.
I´ve browsed through every cck module available and found nothing really helping, so now i hope you can help me!
Thank you
Have you tried the field collection module?
This helps you add a collection of fields as a single field.
So you could have 'Projects' as a "field collection" type field have unlimited number of values. You can then add the individual field like the Project name, description, etc. in the field collection.
This module is for D7.
New answer to an old question (but isn't that how Drupal usually works): you might want to try the Multifield module as an alternative to Field Collection or the other solutions posted here. It's meant for this type of problem.
The module Field group is creating this relation for you.
In Drupal 6 we can do this using Flexifield The project description page of flesifield says that similar functionality can be achieved in Drupal 7 using Combo Field. But I have never tried it though. It might worth giving a try.
For Drupal 8 you can also look into the Paragraphs Module for handling a multiple field with multiple inputs. Can be used for product properties, recipes and more advanced use case where a single field can behave like a content type.
There is also a module for Drupal 7 and Drupal 8 called Double field

Resources