Drupal 7 / 8: I have two Queries. I have been using Drupal since initail days of version 6. But still I find it difficult to manage a few simple things.
Query 1 : I have set of posts (with image) in Content type Article. Now how to create a views in Drupal 7 so that it shows - a list of tiltles along with image of only top article, i.e to say -- like this"
Image from Article 1
Title of Article 1
Title of Article 2
Title of Article 3
Title of Article 4 .. etc.
How to do it in views?

Query 2: My another query is about Hierarchically exposed filter in views. I have contents like nodes about different countries, nodes about different states of these different countries and nodes about cities or countries of these states.

Now suppose a viewer Seelcts from top - United State out of different countries and presses submit - it will take him to United State page

If a viewer selects United States, in the next block it will open dropdown list of different states. Now suppose a viewer selects California and then submits - then he will be taken to California page.

Again, suppose a viewer selects california - it will again open a third dropdown list of Cities/counties in California. Suppose a viewer selects Los Angeles city - then he will be taken to Los Angeles city page.

What is the best way to do it. I tinkered with many modules, including hierarchical select, SHS, client side shs, taxonomy tree, taxonomy lineage.. But somehow I could never succeed.

I have always found great drupal community very patient and helpful. I will be extremely grateful if a Drupal expert shows me some light and suggests ways to do it.

Comments

tiikeri’s picture

Hi ManuAdam, I'm not an expert, but had similar scenarios to solve in the past.

About question 1. I think it could there be a more elegant way, but I can suggest a simple options: you can build a view showing titles only, and you should skip the first item from sorting. Then you should build another view, or a view block which show the image and title of article1. Finally you can attach this view as header of the main view you built first. (or, which is the same, you can do the opposite attaching the "titles only view" as footer).

I'm not sure if you can work it around hiding the field and rewriting the result, I'm not sure this would work for all items.

ManuAdam’s picture

Thanks a lot for this help. It didnt occur to me. Yea, that seems to be one easy way. . I am not sure how to skip sorting the first item. I'll try this

ManuAdam__

tiikeri’s picture

To skip the first item in sorting, just set the "offset" to 1 in the pagination settings: on your view admin panel you have "Pager", clic on (for exemple) "Paged, 10 items" and change offset field from 0 to the desired number of items to skip ;)

One side effect of this technique: the first article of next pages will always have the image.

In my case that was a desired behaviour, because I wanted to show 4 articles in one row and 4 articles in two columns. as you can see here: http://osservatorioiraq.it/categoria/approfondimenti