I have different nodes to which I apply taxonomy terms.
I want to display two separate blocks:
The first block should list all the taxonomy terms (HTML list would be fine) and each should be clickable.
The second block should list all nodes that have the taxonomy term clicked on the first block.
How would I achieve that? I am using Drupal 7 and the Views module. Thanks in advance.
You need to 2 block views for this.
But create just 1 view and the second view is already there in your default drupal views.
Follow this steps:
Create a view.
Select "Taxonomy Terms" for "Show" from drop down.
Select the related taxonomy vocabulary for "of type".
Click on Create a Block.
Click on "save & exit".
This will create your first view block with the taxonomy terms.
Now for the second block which should display all the node related to the taxonomy terms.
you just have to enable a view which is "Taxonomy Term".Go down words in your drupal view list there you will find this view in a disable mode. you need to enable it.
Now just override the view as you want to see that node page to display all the content related to taxonomy terms.Select the fields and filters according to normal view creation as we do.
Create a page for this second block and give path as you like.
Now use Context module(download if you don't have right now) to show the taxonomy terms block on the path you have given for views.
(Hope you will be knowing how to use context if not just leave a comment i will guide you for that)
Related
On my taxonomy term pages for a specific vocabulary I want to display the child terms and any products associated with those child terms.
My taxonomy for this vocabulary is 2 levels deep in some areas and 3 levels deep in others.
I can override the default taxonomy page with a view based on CONTENT but that doesn't easily allow me to display the child terms AND associated products.
I have sucessfully created a view based on TERM that will display child terms AND associated products correctly but Drupal is serving the default taxonomy page over this view even though this view's URL is set correctly.
I assume it is because Drupal wants to display a content view for a taxonomy term by default.
Is there anyway to override this behaviour or another way to accomplish this?
Can I use a page preprocess function to set a specific view and override the default taxonomy page?
The only other possible solution I have would be to create a custom template for the vocabulary and manually query the database for what I need.
You might need to use the path "taxonomy/term/%" instead of just "taxonomy/term".
Using TVI module might help you overriding default taxonomy views
The TVI (Taxonomy Views Integrator) module allows selective overriding
of taxonomy terms and/or vocabulary with the view of your choice.
Using TVI you can easily create custom views to output all terms in X
vocabulary.
I have a page generated by Views which lists 5 Articles at a time. This view is paginated so that page 2 of this View will list the second batch of 5 Articles, page 3 will list the third batch of Articles, so on and so forth.
My question: is it somehow possible to extract fields from Articles listed on the page you're currently on, perhaps via the url? And I only want to them on the Articles being displayed by the page the viewer is currently on and not all the Articles.
My intent is to have a Views Block that would ...
determine what page of the paginated View above you're looking at
determine what Articles are listed on that specific page
aggregate and display the Taxonomy Terms of those listed Articles (Articles have a Taxonomy Term field) in the block
do all the above automatically as you change what page you're looking at
The way I'm going about this is to list all the the Taxonomy terms in a block which is relatively straightforward. What I can't figure out is how to filter it based on what Articles are being displayed to me in a paginated page.
I was thinking maybe this is possible to use it using the url of the paginated page which goes along this format: ?page=1, ?page=2, etc.
If anyone could just point me to the right direction, I would appreciate it. I'm also open to alternatives.
What if you created another display of the same view as your Article page view?
You could add a Relationship for the Taxonomy Terms and then the Fields in the block view would be the appropriate fields from the taxonomy terms. You'll want to setup the same Filters, Sort and Pager options for the two displays are the same. That way the results should match.
Then you might just want to hide the pager from the block view. You could do that through a custom template for that view display, or maybe a preprocess function that hides the pager for just your view, or maybe via CSS.
I'm new to Drupal, and I'm working with a content panel.
I want to create a news content containing a 'category' taxonomy reference field. However, my vocabulary has 2 levels and over 100 terms, so it's hard to choose an category using the simple widgets.
I don't want to create new add content panel, but the panel of Drupal. So any ideas for that?
Try using the Hierarchical Select module.
There's also a tutorial on how to use it at http://eureka.ykyuen.info/2012/05/29/drupal-7-mutiliple-selection-list-for-taxonomy-using-hierarchical-select/.
(The one caveat is that there isn't yet support for using it with exposed Views taxonomy fields.)
I am new in drupal 7 and I want to create one view blog in which I can list out taxonomy as category and in under that I want to display two articles and a read more link to that category. Can any one explain in details how can i do that.
If you use a content type with a Term reference field for your category, it wil automatically create pages for each category with the articles tagged with that category listed within it.
If you want to have more control over these pages generated by the Taxonomy module, you can turn on the Taxonomy Term example view in de Views UI and add and remove the fields you want to display. The layout of these pages can be edited by creating a custom template file in you themes template folder for the file page--taxonomy.tpl.php.
There you could als create an additional block display (I assume you mean block when you say blog), and in the Page settings area, you can turn on de More link, and this will display a more link when more articles are available then you have set you pager to display (i.e. Use pager - Display a specified number of items - Items per page = 2). Make sure you change de setting from For all displays to This block (override) to not override the other displays.
This block you can place in any region on any page via the Blocks UI and is should do what you want.
I would like to have sections of a site so the top menu is a menu of sections such as "About Us". Then I want to have a secondary menu of pages within that section in the left sidebar. I know how to lay this out in drupal, but I want to make it easy for my end users to put the page they create into the proper section of the website. Would it be possible for me to create a taxonomy of terms that represent the 5 or 6 sections of the site and then somehow create the path to the page for the section they select in the taxonomy pull down menu?
Download Node Hierarchy, it has exactly that functionality