- install the views module (http://drupal.org/project/views)
- go to /admin/build/views/list
- look for the "Default Node view: glossary" view
- click the 'enable' link
I don't have a glossary view. The only types of view available for me are Node, File, Node Revision, Term, User. I have the latest Views module installed.
Ah okay, I got it. But I am still having a minor problem.
I am trying to figure out how that "glossary" view was built. I mean, instead of just clicking "Clone" I wanna figure out how they did it. So I played around with all the settings and tried to imitated them with another view. But I just can't manage to have the alphabetical pager to show up.
One thing I noticed in the "glossary" view is that when I went to the "Attachment" display, there the Node: Title argument had a "Style: Unformatted." How would I add a style to one of my arguments? Maybe this is the key for having the ABC pager to show...
Actually, ignore my last post, I got it working!!! For those that are having the same problem and trying to figure out how I solved it, I will explain in this post.
@marcvangend really want to thankyou for the help.
Using Views to setup a Alpha Pager
First you need to create a a Node view. Then add a Page display. You have to set the Style to Table, make sure the Pager is turned on. Then just add all the fields you want to display. For the Arguments, you have to add the one that you would want your pager to sort by. In my case, I wanted it to be by Node: Title. Make sure "glossary mode" is checked. Although I am not sure how the Arguments works or why I have to add it, I hope someone else will explain that to me.
Now you have to add an Attachment display type to this View. This Attachment display type is going to be your alpha pager. Inherit all the settings as the Page display type. Now we are going to make a little change to the argument we used before. Click on your argument that you added, in my case it would be Node: Title. Then under Action to take if argument is not present:, set it to "Summary, sorted ascending" or whichever one fits your needs. Now the Style should automatically be added to this argument. By default it sets it to "List." You have to change it to "Unformmated" and also make sure "Display items inline" is checked.
Sorry if my explanation wasn't all that clear. If I had a better understand of how the Arguments work, I would have given a better explanation. I would really appreciate it if someone explained to me how Augments actually creates the A, B, C, etc... I am guessing its the "Summary, sorted ascending..." thingy that actually creates the "A, B, C"?? I could be wrong, I hope someone will clarify it for me.
An argument is best describes as a variable filter that is passed to the view in the url. Suppose the url of your view is www.example.com/myview. If you go to www.example.com/myview/2009, then the first argument is '2009'. By default, views does not look at the arguments. When you add an argument to a view, you're telling views to do something with that argument. For instance: only show nodes that were created in 2009. In case of the glossary, you're passing a single letter to the view as the first argument. That letter is used by views to filter the list, so it only contains node titles that start with that letter.
Wow, after reading that article you sent me and explanation you gave me, I get a better understand now. Thanks alot for the help.
Just one more question, it doesn't relate to this topic, but since we are talking about views, I guessing you might know. I am creating a list of node titles from a specific content type. Next to each node title, I want to have an "Add Comment" link. So instead of users clicking on the node, then clicking on "Add Comment," they should just have to click the "Add Comment" link next to the node title, and it will allow them to add a comment. Is this possible? I went through all the Fields in Views but I can't find it.
A field like that is not available (AFAIK) but you can easily create it.
- add a node:nid field
- check 'Rewrite the output of this field' and enter the text of your link: "Add comment"
- check 'Output this field as a link' and enter as link path: comment/reply/[nid]
I think this should work, tell me if it doesn't.
How do you do this for Drupal 7? And no, simply enabling the "Glossary View" from the contextual filters, and adding a predefined value and a character limit of "1" does not work. In fact, it does nothing.
I posted this same question on the Drupal stackexchange. Basically my solution was to take the existing and included template and clone it. Then I modified it and voila - it worked! I was never able to create it by scratch, but cloning it worked.
Comments
For Drupal 5:
For Drupal 5: http://drupal.org/project/views_alpha_pager.
For Drupal 6: check the built-in example glossary view.
thanks man!
thanks man!
You're welcome!
You're welcome!
I am still unclear how to do
I am still unclear how to do this in D6. How do I access the "glossary" view?
4 steps
- install the views module (http://drupal.org/project/views)
- go to /admin/build/views/list
- look for the "Default Node view: glossary" view
- click the 'enable' link
I don't have a glossary view.
I don't have a glossary view. The only types of view available for me are Node, File, Node Revision, Term, User. I have the latest Views module installed.
Are you sure you're looking
Are you sure you're looking at the /admin/build/views page, not at /admin/build/views/add?
Ah okay, I got it. But I am
Ah okay, I got it. But I am still having a minor problem.
I am trying to figure out how that "glossary" view was built. I mean, instead of just clicking "Clone" I wanna figure out how they did it. So I played around with all the settings and tried to imitated them with another view. But I just can't manage to have the alphabetical pager to show up.
One thing I noticed in the "glossary" view is that when I went to the "Attachment" display, there the Node: Title argument had a "Style: Unformatted." How would I add a style to one of my arguments? Maybe this is the key for having the ABC pager to show...
Understanding views
Understanding views attachments is important when trying to understand the glossary view. Maybe this tutorial helps: http://drupaleasy.com/blogs/ultimike/2009/02/using-display-attachments-p....
Actually, ignore my last
Actually, ignore my last post, I got it working!!! For those that are having the same problem and trying to figure out how I solved it, I will explain in this post.
@marcvangend really want to thankyou for the help.
Using Views to setup a Alpha Pager
First you need to create a a Node view. Then add a Page display. You have to set the Style to Table, make sure the Pager is turned on. Then just add all the fields you want to display. For the Arguments, you have to add the one that you would want your pager to sort by. In my case, I wanted it to be by Node: Title. Make sure "glossary mode" is checked. Although I am not sure how the Arguments works or why I have to add it, I hope someone else will explain that to me.
Now you have to add an Attachment display type to this View. This Attachment display type is going to be your alpha pager. Inherit all the settings as the Page display type. Now we are going to make a little change to the argument we used before. Click on your argument that you added, in my case it would be Node: Title. Then under Action to take if argument is not present:, set it to "Summary, sorted ascending" or whichever one fits your needs. Now the Style should automatically be added to this argument. By default it sets it to "List." You have to change it to "Unformmated" and also make sure "Display items inline" is checked.
Sorry if my explanation wasn't all that clear. If I had a better understand of how the Arguments work, I would have given a better explanation. I would really appreciate it if someone explained to me how Augments actually creates the A, B, C, etc... I am guessing its the "Summary, sorted ascending..." thingy that actually creates the "A, B, C"?? I could be wrong, I hope someone will clarify it for me.
An argument is best describes
An argument is best describes as a variable filter that is passed to the view in the url. Suppose the url of your view is www.example.com/myview. If you go to www.example.com/myview/2009, then the first argument is '2009'. By default, views does not look at the arguments. When you add an argument to a view, you're telling views to do something with that argument. For instance: only show nodes that were created in 2009. In case of the glossary, you're passing a single letter to the view as the first argument. That letter is used by views to filter the list, so it only contains node titles that start with that letter.
Wow, after reading that
Wow, after reading that article you sent me and explanation you gave me, I get a better understand now. Thanks alot for the help.
Just one more question, it doesn't relate to this topic, but since we are talking about views, I guessing you might know. I am creating a list of node titles from a specific content type. Next to each node title, I want to have an "Add Comment" link. So instead of users clicking on the node, then clicking on "Add Comment," they should just have to click the "Add Comment" link next to the node title, and it will allow them to add a comment. Is this possible? I went through all the Fields in Views but I can't find it.
A field like that is not
A field like that is not available (AFAIK) but you can easily create it.
- add a node:nid field
- check 'Rewrite the output of this field' and enter the text of your link: "Add comment"
- check 'Output this field as a link' and enter as link path:
comment/reply/[nid]I think this should work, tell me if it doesn't.
How about Drupal 7?
How do you do this for Drupal 7? And no, simply enabling the "Glossary View" from the contextual filters, and adding a predefined value and a character limit of "1" does not work. In fact, it does nothing.
There's a decent answer on StackOverflow
http://stackoverflow.com/questions/7354638/drupal-7-views-3-glossary-mod...
-------
http://www.funnymonkey.com
I posted this same question
I posted this same question on the Drupal stackexchange. Basically my solution was to take the existing and included template and clone it. Then I modified it and voila - it worked! I was never able to create it by scratch, but cloning it worked.
Hope this helps other.