HOW TO CREATE TAXONOMY TERM COUNT BLOCK USING VIEWS AGGREGATION?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi friends today I gonna show you how to use views aggregator to create taxonomy term count blog in Drupal 7 so I have already created a tutorial in my site about this and you can come over to my site and check out this here however I hope some of you might have got some confusion so creating this form so I just thought of creating this video tutorial for ECU's so before we get started I just want to show you how this is going to be look in a real site this is dribble comm and they have a page for tags the list of tags they have used in their site and also you can see that this is ordered or arranged in alphabetical form like ABCD 2 all the way down and also at the right side you can see the number of times each tags has been used probably you might want to use the same feature and how do you use these without using any specific any special module other than views and c2 so there is a new or there is a function it's not a new function anyway there is a function in Drupal 7 views called aggregation and we are going to use the functionality of aggregation to get this thing happen so first thing is we need to install the tuple 7 and download the views module and see tools module and come to the site and install all these modules and make sure that you have a few contents it can be blog or article anything and also some kind of tags or what do you same terms should be attached to them blog post you have created the first thing to create the view east go to the structure and under the struct go to views and create a new view let's call this view as popular tags and make sure that you are creating the view as taxonomy terms not any other Shore taxonomy terms of type or since I don't have different types of vocabulary I just used it for all let's say you have different vocabularies like blog or calendar or different things then you can choose if you want to use only special vocabulary starjetter for now we just leave it as all and we don't need to create a page now and we don't need to create a blog now just leave or unchecked and click continue and edit button in this page this is the master views settings page here you can see there is already one field is created which is taxonomy term name and if you scroll down you can see all the all the taxonomy terms or the categories I have used in my blog here so you don't want all these lists of taxonomy terms displayed as a block rather we want to use the most used to five terms or most used to ten terms or something so for now in the pager section we are going to change these settings so I just want to display only the top five taxonomy terms use this might used in my block so please click on this setting like display specified number of items and click outline and in the next setting click remove the ten and change to five so the most used five terms will be displayed click apply and if you scroll down you can see the pager has been gone and top five not top five for now five taxonomy terms are displayed here but these taxonomy terms which is displayed here are not the top file how can we make them the most used for that what we have to do is the first thing is we have to make a relationship first means the taxonomy term used with a content so all the contents related related to the taxonomy terms used will be displayed here so click Add relationship and then require this relationship and click apply it doesn't change anything much you can see at the left side the the taxonomy terms have refreshed into new terms that's only changed when you need the relationship but the main thing is aggregation you can see use aggregation now it is set to no so click on the no and you get a pop-up screen like this and click and be gate and click apply and from now on you can see a new setting has been enabled next to the field called aggregation settings for now just don't do anything there if you scroll down at the bottom there's nothing special same but create one more same taxonomy term name field as this one I say taking same taxonomy term name field same field so we just gonna add one more taxonomy term name field and this time we are going to set this as count the aggregation type as count so the first field is set to group result together by default so that's okay and the next field the same taxonomy term name field should be set to count and now click apply and continue and here you get more specific field specific settings like setting the label things like that so we don't want the label for so we remove the label and if there are separation like how do you want to separate the zeros like thousands marker for now I just leave it as comma and prefix and suffix I recommend you to add this as maybe like a comma or I mean sorry a bracket so that it displays the number is displayed within this bracket and click apply and now if you scroll down you can see there's a new count number is displayed next to the taxonomy term but however these numbers or the taxonomy terms are not the most used ones as you can see it starts from 1 1 1 to 2 it's not ordered in the wavy one so how can we reorder these to show the top used one at the top and then downwards for that we have to sort these list by the top used two terms so click on the sort criteria and then here we gonna add a taxonomy term ID make sure non taxonomy term name taxonomy term ID and then click taxonomy term ID and click add and configure sort criteria button and here make sure again choose count and then click apply and continue button and from the next screen you have to sort by descending means that the highest value will be at the top and the lowest value will be at the bottom that click apply button and now if you scroll down you can see that the taxonomy terms with highest value showing at the top and the lowest value is showing at the bottom and they are the first or the top five terms and now we have done with that in the master view now we need to create this asset block if you want to create us a block or you can create it as a page if you want to create it as a page also you can change the formatting of this thing like a list view or a table anything you want for that this thing be let's say we wanna create this as HTML list in the master and then let's say unordered list is fine and if you want to group these by the taxonomy term name or something if you can do that or if you just want to leave it as it is then it's fine click apply and now if you scroll down it is listed as an unordered list next let's create a block click this from here and click add a new block view and all the settings are converted to this block thing and we have just created a block and we are going to create this block title name as popular tags apply all the splines and now this is a to HTML list and that's fine and if you want to give the name for the blog you can give that name here so that it will be displayed for the end user you can also override the setting in the block setting screen and you can see the popular tags the block we have just created a block now let's create a page click page view and in the page view you must define a path in the beginning itself so let's say tags and then click apply and since it's a page it won't be looking good if you display the taxonomy terms as a ListView so let's display this as a table for now so let's change the formatting style into table oops I had to change this to all let's say this page alright so that the styling will be only for this time and then we don't want to group anything just apply this display and now the styling has been changed into a table view and if you go back to the blog that's also override unto the table so we don't want that so we just change that to HTML list back okay now we have created a block view a page view as well now what else to create yes if it is a page view maybe you can display all the terms not just the five terms since you need to show that all terms so for this page we are just going to override us all the terms to display in the page and now if you scroll down all the list of fit all the list of terms used in the page are shown and let's go back to the block view again here just I just forward wanting here is the styling okay in the block view oops taking a little while okay come back here you can see there's a Shaw field settings in the field settings we can show this as an inline I will just cancel this and I will show you how it is looking now you can see that taxonomy term is displayed at the top and the count number is displayed at the bottom it doesn't look good if ET but we want to show it as an inline like next to the tag term the count number so for that we don't need to go to the style.css changing something we can do it everything from here itself just inline field just check what this mark and click apply all field and now if you scroll down you can see the counter is sorry the count number is displayed inline with the taxonomy term and that's all we have to do with the views and we have done everything now we just clicks a button of the views and we have just created the views page now if you go and view the page of tags you can see that in my side the most used dance in my site is these are the most used to tags and what happens to the block you can see the block is not shown if it is not I have already enabled this block that's the way it's showing at the right side if for you if it is for the first time if you're creating you how to go to the structure and then from the blocks list if how to add that block so for me it's already showing up in my side and if I type slash tags the list of tags are also shown here and we can change the style and if you want to add extra fields and settings and things like that you can do and you can play around with these if you want to do all kinds of styling settings you don't need to do any coding or programming or nothing it's all within by Drupal and you settings hope you got this idea and hope you got the idea to work on something better than these and that's how the views aggregation works and there are much much more possibilities using this views aggregation settings such as creating a graph like you can use on yeah like a Google graph using the Google API to use graph like a and what else all these settings you can use for using views aggregation and hope that helps you and please let me know if you have any questions or come across any problems and just coming me on my site or my on my YouTube and that's it thank you so much for watching bye bye
Info
Channel: Bright Web Design Studio
Views: 13,724
Rating: 4.9565215 out of 5
Keywords: Drupal7, Views, ctools, Aggregation, Taxonomy, Tag Count
Id: w22Utjm-chs
Channel Id: undefined
Length: 17min 8sec (1028 seconds)
Published: Thu Jan 17 2013
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.