Drupal 7 and views

nick2price's picture

Hi. I am having a bit of trouble with views in drupal 7. I have created a Content Type which expects a user to input data into fields. I then choose views from the structure menu, and I add a new view. I give it a name, and under Create A Page, I give it a title, path and set the format to
Grid of Fields
I then create a Menu link.

On the next page, the Views UI, I go to the fields section and add field. I tick everything that relates to my Content Type e.g. Content: First Name
Appears in: node:introduction

Where introduction is my Content Type.

Under configure fields, I create a Label and click apply. Now, what I am expecting is a field where the user can enter their First Name. However, nothing is displayed. If I create content and give everything in my Content Type a value, then displaying it in views is not a problem. Its when I want to use the Content Type to allow users to enter a value the problem arises.

Does anyone know what I am missing, or where I am going wrong?

Many thanks

Nick

Comments

Unless something has changed

idcm's picture

Unless something has changed significantly in Views for D7, views is not used to collect data. Views is used to "view" data that you have already collected. You can expose filters (which makes it seem like it is "collecting" data) but those are just values sent to the query and not values stored in database fields.

Has the INSERT query option been added to Views? I think it only creates SELECT queries.

Kool, I was thinking that may

nick2price's picture

Kool, I was thinking that may be the issue. Do you know of anything like views where I could display fields?

Cheers

You have a CT with fields and

idcm's picture

You have a CT with fields and you want visitors to fill in an exposed field, right? If I am understanding correctly, maybe this is what you want http://drupal.org/project/formblock.

Yes, thats correct. I am

nick2price's picture

Yes, thats correct. I am actually attempting something which hopefully someone can help me with. I have create several content types where the user can enter their details. I now want to display each one of these content types within the main menu. I go to add links in the main menu, but I have no idea what the links to these content types are. No content has been created, just content types. Is it possible to do what i require?

cheers

If you want a CT to appear as

idcm's picture

If you want a CT to appear as a "page" then you need to use the node/add/ path in the menu item. You need to make sure your permissions are set so that your visitors can access these create content forms.

I think I have done that but

nick2price's picture

I think I have done that but with a bit of an issue. I went to create content type and right clicked on my content type to copy the link. I then went to the structure menu and added a link to the main menu. I gave it a title, and the url to my create content type page. Saved it.
So now it appears in my main menu. I click on it and it displays as if I was creating a new content type, perfect. I add text into the fields and hit save, and it then displays it within the menu item, and it has its own view/edit tabs. Thats exactly what I wanted and everytime this link is clicked, the content should be edited through whats already there (using the view/edit). However, if I click on the link again, it starts the process from the beginning, creating a new content type and overriding the old one. Is there anyway of making the initial process of creating content only a one time deal, and once this is saved, to always have it edited directly through the created content?

cheers

If you only want the create

idcm's picture

If you only want the create form available once, you would not make it a link on the menu. Create it once and set the menu link to edit that specific node. If you want to be able to edit existing nodes after they have been created using a menu link (like that described above), then you would want a view to list the nodes as they are created and set the title to be a link to the node. If you want any one to edit a node, then permissions need to be adjusted so your users can edit all nodes of that type.

Drupal in Education

Group organizers

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: