1

This is a very basic question so please check for idiocy as I haven't worked with views that much.

I want to edit the main page of a content type like an article through views. To me it seems views only works with the "listing" of the contents not the content itself. I might be missing an option right in front of me but I can't seem to figure out what it is.

Repeat, I want to edit the main content page not the listing. Please help!

EDIT: This is the screenshot of my content page. I want change this layout through views like reorder the fields or add new ones like it's typically done in views. So is it possible?

Drupal has done this ugly presentation itself and I want to change it.

enter image description here

5
  • 1
    Why do you need to edit a node with views? Is there something wrong with the normal edit page? Or are you looking for a data-entry style grid of content fields?
    – Clive
    Commented May 10, 2012 at 11:53
  • 1
    I want to do this because currently my content page is too messy and I want to organize the fields in it. Like changing order of the fields and adding other ones. I'm also getting two comment boxes in my node happening by itself which is weird. So can this be done through views? Commented May 10, 2012 at 12:03
  • I don't know to be honest, if you want to re-order the fields in a form you'd normally implement hook_form_alter() in code and change the weights of the elements. Views can be used for data entry though, the Slickgrid module might be a good place to start
    – Clive
    Commented May 10, 2012 at 12:05
  • 1
    Or, do you perhaps mean you want to have the contextual links (gear icon) available over each node in field-style view, containing a menu item "Edit"? Excuse idiocy on my side ;-) Commented May 10, 2012 at 12:16
  • is your row style field or node for your view?
    – au_stan
    Commented May 10, 2012 at 12:19

4 Answers 4

2

You are basically right regarding views. Views is a way to see data aggregated together in some fashion. Think visual SQL.

The original request seems a bit confusing to me. I think you are asking for 2 things. Theming the content based on type as well as theming the views output.

For content type, take a look at theming nodes by content type . Drupal 6 and 7 are different in the way they go about this but for drupal 6 you are more or less looking to use the template node-[NODETYPE].tpl.php. This will adjust your node's output on a full view.

For theming your view, take a look at your view in the edit mode. Under basic setting you will see Theme: Information. Click on that and you will get a listing of possible templates that you could use to theme your view. Generally the same way you would edit your node type template you would edit your views template file. Check Theming Views for more info.

1
  • I've edited my question. Please add your suggestions. Commented May 10, 2012 at 12:50
1

Having read your edit, let me try: the key would be to add to your View a field labeled "Content: Edit Link" and insert into your template using print $fields['edit_link']->content. That should get you the link to open the node edit form.

0

As usual with Drupal you have several options:

  1. You could alter the form using hook_form_alter(). It might seem scary, but it's the easiest way sometimes.

  2. You could use field_group module to put your unused fields into separate tab, it's quick and easy and greatly improves usability

  3. you could override the edit page using page manager and panels, there is a nice tutorial available at http://dev.nodeone.se/sv/node/814

0

I found the solution by creating a panel of my content type and editing the Nodetemplate.

2
  • why create a panel when you can edit the template file out right ?
    – au_stan
    Commented May 11, 2012 at 12:50
  • I didn't know how to print out individual fields out of the '$content' variable. And besides that I don't know how to make relationships like it's done in views. So, problem solved! Commented May 11, 2012 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.