-2

I have created a custom content type to upload documents in English and French.Currently using views module I am listing the uploaded files based on date of creation,now I have to categorize the files on list view based on the language(en/fr).

Existing view

Docs

  • French1
  • French2
  • English1
  • French3

I have to separate the listing based on document language and display it as two blocks with different title.

Required view

French Docs

  • French1
  • French2
  • French3

English Docs

  • English1
  • English2
  • English3

Edit

I have achieved this using View module itself.

  • First I have created the option to choose uploaded language and sort order in the content type.
  • Created a view to display French Docs in the required order.
  • Included the view block for English in the Footer section of views for French like : Global: View area (Global: View area)
1

Well, drupal can't know the language used in uploaded files unless the user or an admin specifies so.

A simple way to achieve what you want is to-

1) Have a checkbox field holding the values "English or French" in your custom content-type.

2) And then you can create two views, one holding "English docs (filter:Checkbox=English)" and the other "French docs (filter:Checkbox=French)".

3) Embed one view into the other as a view field using Views Field View.

views_field_view allows you to embed one view into another view and pass arguments along.

  • Thanks for the replay. Instead of using Views Field View module I have included the view block for English in the Footer section of views for French like : Global: View area (Global: View area) – developer Jun 16 '17 at 5:23

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