I'm still young at Drupal.So please correct me wherever needed.
I have a requirement wherein I want my content type to have my own fields (achieved with CCK), then I want one of the fields to be a selectable drop down and each drop down value should actually categorize them so that each type can come on separate page. This I managed with taxonomy. And in addition to these,I wanted some other fields in the same content type to be dependent on a particular value in the drop down. So I used conditional fields. And in order to use taxonomy term as field,I used content taxonomy. But unfortunately, conditional fields doesn't see the content taxonomy drop down (it works perfectly well if its a normal non-taxonomy drop down).
So basically,
I want content to be separated (i.e.
on different pages) on the basis of
a value selected from drop down.
And if a particular value is
selected from drop down, few other
fields should become visible.
How am I to incorporate these things? Am I on the right track or completely off track?
I am using Drupal 6.14. :)
Thanks for all the help!
I think you are on the right track, but the Conditional Fields is still in beta, so bugs/missing features are to be expected. Also, Content Taxonomy is a bit special compared to other CCK modules, as it only provides a replacement of the taxonomy fields on node edit forms, but is not present/active during node rendering.
That said, your Problem is already filed as a feature request in the issue queue of the conditional fields module, and there are some patches available and discussed to solve it - so you might want to check out that thread.
I'm not completely sure how you require the 'different pages' part to work, but if everything else works with a non-taxonomy dropdown - and you don't have time for the issues with Conditional Fields to get shaken out - then you may be able to set up a View page that filters on the value of the CCK node.
Related
it's about this page: http://veagues.com/
Hey guys,
I've made a block-view with drupal that let's me sort my videos by a certain category, in this case "funny","epic","plays", "contest"...
The problem is: When you sort it by the certain category and click on a video and continue to click the "next" button, you will go threw all videos, instead of only the videos of the category...
My Question is: How can I put a filter on the nodes when i apply another category on the bottom block?
Thanks already!
If you're using Views, you should be able to filter the main block by the same taxonomy term.
Try adding a Contextual Filter to that block too. If there's a taxonomy term ID in the URL the block gets filtered by that Term ID and if there's no result, the block shows all the videos.
EDIT -----------------------------------------------------------------------------------------
You may need to try & understand what goes on when you make a selection in Drupal.
1/ The taxonomy term page will list all the content affixed with a specific term. The term tid can be seen in the URL, unless an alias have been created. A block can retrieve that term id, whether there is an alias or not.
2/ The node page will give you access to a specific node, but any block on that page should be able to access the term id of that specific node.
If you know where you are, it becomes easier to retrieve the info you're looking for. On the other hand, you may have to reconfigure a specific page in order to add the necessary extra block...
That can be done with templates but you could also have a look at Panels.
The Panels UI makes it easier to configure the page you're looking for without having to mess with code or templates, or both.
There's a lot of free video tutorials out there, search for Views & Panels.
If you want to have a look at preprocess functions, you will definitely need to download the Devel module...
...but have a look at these sites first:
http://codekarate.com/
http://drupalize.me/
http://buildamodule.com
This seems like it should be relatively basic, but I can't seem to wrap my brain around it. I have a client in need of some advanced filtering for thousands of different content items. Each content item will be filed using different taxonomy types. As you filter through the system, it should eliminate content that does not correspond to the selected taxonomy.
So far, so good.
The issue is that the filters should update based on taxonomy of the selected content.
In this particular case, there's a select box for Location, Hunting/Fishing, and Species. If they select Illinois > Fishing > Freshwater, the last filter (Species) should only show tags from the Species list that correspond to previously selected filters.
The system works fabulously already but displays every species of fish, not just the ones from the selected filter.
Any guidance would be tremendously appreciated.
I would recommend Views_Hacks module for this (Views Selective Exposed Filters submodule) as also as an AJAX enabled and Autosubmit views.
Drupal facet search https://drupal.org/project/facetapi will give you the required functionality.
A quick search on google for 'faceted search drupal' will give you lots of tutorials on how to set it up, one of which being: http://envisioninteractive.com/drupal/drupal-7-views-with-faceted-filters-without-apachesolr/
Is it possible to elegantly do this? The idea is, a node of content type "project" has a lot of fields, its url is something like node/5. I want to show some of the fields on that page, and others on node/5/extra, kind of an "extended" page that the user only loads if he is interested in that content (lots of images, in my case, that would slow down the main node page considerably).
I tried the Display suite module, unsuccessfully (it seems it's not really meant for doing what I want). I also saw this blog post, which explains how to add a custom display mode to a content type (other than the Default and Teaser ones that come by default), but I can't get it to work the way I want to either.
I guess you could create a view having the node ID as a default argument from URL. Then you can choose which fields to show or hide
Suppose my website sells cars and other methods of transportation. I have a content type called Product and it is categorised with a taxonomy, eg. Cars, Bicyces, Boats, Helicopters.
The Product content-type has some CCK fields to describe basic features of the product, such as horsepower, number_of_wheels, and top_speed.
I use views to override the taxonomy term page, and show some exposed filters so the user can narrow their choices.
My problem is, that some of my exposed filters aren't really applicable when viewing certain terms. For example if I'm viewing the Bicycles term, I don't want to be able to filter by horsepower! Or if I'm viewing Boats I don't want to be able to filter by number_of_wheels (because none of my boats have wheels).
So is there a way to hide an exposed filter for a field if no rows in the view contain data in that field?
Having just one content type "Products" although simple, will ultimately cause redundancies and problems, such as what your experiencing now. It's far better to add individual content types; cars, bikes, boats and set fields unique to them. That way you can create filters easily in views against the content type.
If you were to create the table in mysql would you have just one table Products? I hope not. ;-)
If you're not able to branch your content types as Gary Green suggests, making separate views (with more granular control of view filters), you could perhaps you could use hook_form_alter to check the default value of the taxonomy field corresponding to your product type (bicycles, boats, etc.), and then remove fields by setting #access for those fields to FALSE.
If you're not comfortable with using hook_form_alter, you could also set these to display: none with jQuery (don't remove them, or the forms won't pass the security / integrity test upon submission). Unfortunately you can't do this with simple css because, at least in D6, CCK filter input elements don't have specific enough id's or classes to allow easy css manipulation.
This presupposes that you have separate views pages for each of the taxonomy-determined product types; your description sounds like this type of setup.
After only a few weeks of working with Drupal I've come up with a recurring problem, which I don't really have an optimal solution to, so I'm hoping that someone here might be able to give some best practice pointers.
What I have is a region inside my node.tpl.php, which is populated with blocks that display content from two different CCK fields of the type node_reference. This works fine when displaying a single node. The problem appears when I need to use a view.
For example, lets say I have a news listing, and a single news item view. When I display the single news item I can use the news node node_reference field to reference whatever material I would like to have in my sidebar, but when on the news listing view I would like to reference nodes separately. What would be the best practice to solve this?
I'm having a few ideas, but none seem like the logical choice, how would you do?
My understanding of your problem is that you don't want the blocks to display on the view page and you want the block information displayed inline with the node.
The first part is easy, you can modify the block visibility settings to not show up on the path where you have the view.
The second part will depend on how you set up your view. If you are using fields you can simply add fields for the node_reference and they should display. If you are using a node view, you will have to override the template and create a template which displays the node reference field.
If you want further explanation please comment and I can clarify
After reading my question I realize that it was explained pretty badly, so I'll try again, and also tell how I solved it.
The Problem
On normal "pages" (when displaying only a single node), I have a sidebar that shows something similar to banners, which are either random, or I can select one or many that should always be displayed on the sidebar. This is solved easily when displaying a single node, using a CCK node_reference field. The problem is when using a View that displays multiple nodes, for example a news listing-
The Solution
In my case I could solve this by creating additional fields on my default Page content-type. These fields were called view, display and arguments. In my tpl.php I then embedded the news listing view inside a page, lets call it News. This way I gained great flexibility, and also helps the News page to know where it is located in menu structure.
Final comments
I have yet to discover if there are any drawbacks or dangers in doing this way, but if there are, feel free to share them with me :)
I tend to want to create my own modules, which create blocks and reference the database directly. Then I put the blocks inside of panels, this seems to be more flexible for me than using views and cck fields etc ...