In Drupal 6 how to show field other than title field in select list of related content types - drupal

I have two content types Institute and Faculties. The title of the Institute content type is Unique Institute Number. This content type also contains Institute Name field. In the Faculty content type I want users to select the Institute Name from a select list. With Node Reference I can show the Title of the Institute Content Type in the select list but Institute Number is not a comprehensible Information list. How can I show the Institute Names in the select list

IIRC, using the titles of the selectable nodes is just the default behavior - you can change this by using a Views module view. On the Node Reference fields configuration form, there should be an 'advanced' section where you can select a view as the source for the select functionality.

Related

State/Province select list is not populating on selection of country in Address field drupal 9

I have added Address field on Webform in Drupal 9[version: 9.2.10]. But the State/Province select list is not populating when the country is selected from country list.
Current version of Address module is 8.x-1.10 [latest]
See image here. Though India is selected in Country list, it still showing US states.

How do you configure views block based on node reference in Drupal 8/9?

There is a node pages that holds reference fields of the taxonomies (course type and semester). For example:
Summer Literature Courses: course type of 'Literature' and a semester of 'Summer'.
There is a node courses that holds reference fields of the taxonomies. For example:
ENG 101: course type of 'Literature' and a semester of 'Summer'.
MTH 101: course type of 'Math' and a semester of 'Fall'.
I need to somehow get those courses on the page that both reference the same course type and semester
I figured I could create a views block and place that on all pages that have course type and semester defined. But I can't figure out how to configure the View to correctly filter the courses. Any help would be greatly appreciated!!
Create a block view that displays courses (content type filter).
Create 2 "contextual filters", 1 for course type and 1 for semester.
In the above contextual filters, set them both to "When filter is not available" to "Provide default value" -> "Content ID from URL".
add the block to the page.
Both the "page" and "course" content type must be using the same fields for referencing the course type and semester.
On the view settings page (admin/structure/views/settings) there is a setting for "Show the SQL query" which is helpful to see the SQL query on the preview

Drupal Views search by one field and sort by another

I have a problem with Drupal Views.
I have a content type "Company". "Company" has a "City" field (taxonomy term reference) and "Company type" field (A,B,C).
How can I – inside a view – search for City and order by Company Type at the same time?
For example I want to search for Paris. And then I want all Paris Companies sorted initially by Company Type. First A, then B, then C.
How to enable sorting like that?
It depends a little bit on how you display your companies. As table or as list? But generally you simply can add multiple sort criterions.

Drupal 7 : View filtered with taxonomy / user relation

I have a view "news" which is listing nodes from "news" content type.
This content type contains a field "countries" which is multiple.
So, my news "Test 1" will have a field countries like this one :
France, United Kingdom, Spain
My users have a field "Country".
What I want to do is to add a filter criteria in my view meaning :
News.countries = Users.country
At this moment, when I try to do it, I cannot set a "must be equal to" to News.countries, certainly because it is multiple.
Can you explain to me how should i do ?
You should use a contextual filter. Add a relation to current logged in users country and add a contextual filter for the field new.country and use the relationship.

Hierarchical select module issue in drupal

i am using 'Hierarchical select' module in Drupal to create 2 drop down of States and cities and connecting the city ones to state in a way by changing the state,the list of cities changes too.(it is beside of CCK and taxonomy content module)
The problem is that by selecting the state and city for a new content,just the city shown.but i need both of them,State - city combination.
Hierarchical select is UI representation of hierarchical structure of vocabulary that is normally shown in a flat list.
From a single vocabulary (if multi select is disabled) you can select only one term. Selecting a leaf would not enlist parent tids.
Use taxonomy_get_parents() or taxonomy_get_parents_all() functions.
If you have all that data inside of one vocabulary and cities are children of states, once you select a city, it should display State >> City on the node. if you're displaying them with $terms; then it should display in such fashion.

Resources