I have something in Drupal (v6) that i'm trying to nail, but having a little difficulty. I am laying out a list of products which have the following taxonomy vocabularies attached to them:
Manufacturer
Product Type
Use
When entering a product, which uses a custom content type, the admin can select one or more terms from each of these vocabs.
I then need to lay the front-end out using Views as follows:
List of Manufacturers displayed to the user - user clicks one
List of Product Types displayed to the user that have a product contained within that matches the chosen Manufacturer - user clicks one
List of Uses displayed to the user that have a product contained within that matches the chosen Manufacturer and Product Type - user clicks one to view full node details
The tricky bit is making the link between each of these vocabs using Views. The taxonomy vocabs have no hierarchy defined within them, I just need to be able to display them to the user in the order above. I can't change to using a nested hierarchy in just one vocabulary as the 3 seperate vocabs are used elsewhere on the site for other purposes and need to stay as they are.
Is it possible to create what i'm after with Views? Any tips on how best to rig it together?
Could use 3 views, with the 2nd and 3rd taking arguments.
So a url could look like:
/products/ - 1st view
/products/Ford - 2nd view, one argument
/products/Ford/Cars - 3rd view, two args
That said, for something like this I'd probably just write a custom module. How practical that is depends on how comfortable you are with Drupal and PHP.
Related
Is there a Drupal module that will let a user edit some profile fields or a field collection on a specific page. For example, assume I have a page that talks about the benefits of different levels of college degree and a Field collection that captures degree level and school name. I would like to have those profile fields editable on that page.
Is this possible?
Assuming you mean profile2, you can write a custom module containing a block, a good example of a custom blok is included on https://drupal.org/project/examples.
Then you can use hook_form_profile2_form_alter to call the individual fields making up your form.
I'm going to try to explain my project.
I have one section to create on my drupal's site called "Press Room" in this section the users access it via menu item called "Shows". The mainly idea is that the second level of this menu will be created with taxonomy vocabulary called shows and the terms of this are for example:
-Shows(Voclabulary)
-Heartland(term)
-Bulloch Family(term)
And now the next step is create for each one of the terms the next structure:
-About
-Press Materials
-Video
-Fotos
To be more specific I've attach two piece of wireframes of these.
What is the best way to do that?
Thanks!!
[The menu show like that][1]
![The content once you click in the menu][2]
http://i.stack.imgur.com/tijAU.png
http://i.stack.imgur.com/1oifQ.png
I can propose a solution although there are too many options here.
1) Heartland(term) -Bulloch Family(term): there is no need to use taxonomy terms, they can be node types (let's call it "Show" content type).
2) About, Press Materials, Video, Photos and Contact will be 5 node types too. But these will have a reference field to the node types above (Shows).
3) The display page of each Show will be a views that will display the node Show and the content that are referencing this node.
4) Menu can be created by hand (if shows are not too many) or by a views that will show a list of node links.
Examples:
http://ericgilbertsen.com/2013/06/create-related-content-blocks-drupal-7-views-entity-reference
http://www.webomelette.com/related-content-block-views-drupal-7
I'm using Umbraco 4.7 to develop a website. There are certain common elements across some pages like 'Contact Details', 'Latest News', 'Latest Products', etc. For example, one page can have contact details while other may have news. I want to create some sort of macros (HTML or Razor) and want to add these on the required pages. But I also want this content to be editable by content editor. How shall I create such editable macros?
I will assume that you are familiar with Razor and creating macros. If not, there is a reasonable article here.
There are several ways to do this, but each depend on the type of content you wish to display. For example, a 'Latest news' macro can be created with only code by just specifying in the razor to select the top 3 news articles, ordered by date descending. Likewise, if the contact details data already exists on another page (e.g. About us or Contact us), then you can just use the Razor to locate the page and pull the field values you wish to display in your macro.
However, as soon as you want to have some control over which items are displayed in your macro, you will need to create some additional means of controlling this. In the case of your products, you will probably want to select which are displayed in the macro, and therefore across the site. Therefore, you can:
Add a yes/no field to each product (e.g. called 'Display in side bar') and this can then be used the macro to filter the products display; or
Create a new document type called 'Side bar products' that contains a uComponents multi-node picker that will allow you to select products. You can then create a node from this document type and in your macro you will use Razor to query the products in this node. (You will obviously have to ensure that this node is not displayed in the navigation of the site!)
This second option is by far the better option as it is easier to maintain, provides a little scalability and also allows you to potentially have multiple 'Side bar products' nodes, so you could have differing sets of products in different sections of the sites. The first option is certainly easier to implement, but can get difficult to maintain since you have to remember which product is ticked.
I want to arrange the people's section of my drupal 7 admin page. Right now, the People/users are arranged according to usernames, status, roles, member for, ....etc. I want to make it look like last name, first name, employee id, ....etc (these are custom profile fields.) Then finally I want to arrange it alphabetically according to their last name. I have tried using views but ended up with the following two issues: 1. I couldn't find the custom profile fields like the first name, last name, ...etc, and 2. I have to either create a page or block to access the results of the views page (I want to make everything in the people's page.) I would real appreciate your help!!!
If you're referring to /admin/people, you can create a page and use that path in your view, and it'll override the default /admin/people page. This is an explicit feature of the views module.
Bear in mind you'll have to mimic all the existing functionality you want to keep from the admin/people page (eg exposed filters and sorting), and make sure you set the access permissions on the view to ensure only admin users have access.
As for not being able to see custom profile fields, do you mean they're not showing up in the list of fields to select? I don't know why that would be... if you've created a view based on Users, then the fields will show up under the "User" category (User: first name, User: last name &c). I've checked my own install and everything's showing up fine. Further info?
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.