Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hi,
I'm trying to create a view of all the users in my site,, n i need an alpha pager on that view. Any idea how to get that done??
I tried to clone the glossary view, but its not working...
Thanks..
Comments
Comment #1
ravi.kumar88 CreditAttribution: ravi.kumar88 commentedThe solution can be achieved with the help of contextual filters.Please follow the steps:
1. Create a view with the field of your choice that you want to display.I have used content:title.
2. Go to advanced->contextual filter and create a new filter content:title.
3. Select Provide a default value and give the default value of type fixed for eg "a".
4. Now go down and under the "More" select Glossary mode and insert character limit=1.
5. Now add a block and there in the contextual filter select the "Display a summary".Also select "display items inline".
6. Save the block and go to the page of your view.You will see the list of all content titles having their name starting from "a".
7. Now go to blocks and configure your view's block to show above the view page only.
Thanks
Comment #2
Lars Bo Jensen CreditAttribution: Lars Bo Jensen commentedThanks a lot, ravi.kumar88 - it's very useful.
I made a nice page out of it. I'm sharing a few tips here. Maybe someone find it useful.
My page is for taxonomy terms, and i am using ajax for for the alpha pager and the pager and supplying the pager with a an exposed filter in a block.
I use the taxonomy term name for the contextual filter. I added a mandatory relation to content with the term in order not to display terms without content.
3. -> I let the page display all results, when there's no value in the URL. That's not better than "a", I just wanted it like that.
5. -> Instead of using a block, I created an attachment, which is attached to the page, above.
Both the page and the attachment use ajax, so that the page loads the ajax way. The attachment does not inherit the contextual filter values.
I gave the page the taxonomy term name as filter criterion or whatever it is called (none of my Drupal sites speak English), and exposed it, so that users can filter the list by typing parts of the term names - this is also ajax-ing. I let it be exposed in a block in order to put it outside the main content region.
I display fields and added the taxonomy name twice. The second instance is hidden, shortened to the length 1 and set to be displayed in a H2. The results are grouped by this field, using rendered output to group rows, thus structuring the list neatly with headers.
Comment #3
renatogHi guys.
The tutorial of Lars Bo Jensen is very useful.
RTBC
Comment #4
renatogThank for your help, Lars