2

How can I make content type appear as a table each time I add content through it or its easier to make it in Views?

I am trying to make a website for students and each students will see some numbers and statistics only for him (absence, degrees, home works, etc). So how can I make a table in specific content type to fill the data instead of making a table for each student?

6
  • Override node.tpl.php or use Views or use Panels etc. Probably easiest in Views. And remember that you get modules that can embed Views output as a field that you can drag and re-order in the display. Feb 5 '16 at 12:14
  • This is for Drupal 7? Feb 5 '16 at 18:09
  • do you solve the problem? Feb 10 '16 at 7:17
  • @AdrianCidAlmaguer : since D6 is no longer supported, and D8 is fairly new, a best guess about the used Drupal version, I think, is ... D7. So I even have started to assume that without asking. In cases where that assumption is wrong, the OPer should tell so, no? Mar 24 '16 at 8:05
  • 1
    @Pierre.Vriens I don't know why many users come here searching for a help, but don't collaborate with the site. Mar 24 '16 at 12:36
2

Use the Views module to show all your Students in a view and then with the help of the Views link area module create a link to Create Students.

The Link Area module provides an "area plugin" for Views 3. It allows customized links to be placed in the header, footer, or empty text of any view.

The obvious use case is to create a list of all nodes of type "foo" and then add a header link to the node/add/foo page. By making it a real link rather than just a blob of HTML in a header text area it gets all of the special handling and clean URL friendliness and base-path portability that any Drupal link gets.

1

Option 1

Use the Views module to create a table (list) of all relevant data about your students. Then use the Editable Views module for inline editing. Some more details about this module (from its project page):

Editable Views lets you create Views where the fields can be edited. Fields show both the current value and a form to edit it. A 'Save' button allows saving of all the entities shown in the View.

Also, if you're going to display the block view on the user page of each student (ex: /user/10), you need to add (under Advanced) a CONTEXTUAL FILTER of user: uid. Then select default value. Type: User ID from URL.

enter image description here

Option 2

Use the jEditable inline content editing module. Some more details about this module (from its project page):

The jEditable module provides integration between Drupal's CCK module and the excellent jQuery plugin, jEditable. It is implemented as a CCK formatter, which makes inline editing possible through regular node displays, Panels, Views, or anywhere else you can place a CCK field.

Currently supported features are "click to edit" functions for text fields, number fields, date fields, node reference fields and workflow transitions.

So what is this good for? it provides a very quick and easy way to update the things they need to change without having to edit specific fields without having to switch to the full-blown node editor.

It is with Views integration that jEditable really comes into its own. It allows users to edit many nodes at the same time, e.g. if the same field must be updated for many nodes.

Attention though if you'd go for this option 2: this module only has a DEV version fpr D7 (their is an official version for D6), and its last commit is from 3 years ago. So if I was to decide, I'd only go for option 2 if option 1 wouldn't fit.

5
  • 1
    To add to OPTION1: If you are putting this view on the user/student profile page, you will want to add a contextual filter of user: uid. Then select provide default value and select User ID from url. see this picture Note: the view preview will become blank, don't worry, the view will show up when you view your user/student page
    – No Sssweat
    Feb 6 '16 at 7:58
  • @NoSssweat : interesting suggestion, though I'm not 100% sure I understand what you mean. Why don't you add another answer like "To further enhance the option 1 part of Pierre's answer: If you are putting ...."? Feb 6 '16 at 8:07
  • 1
    I'm not 100% sure I understand what you mean I mean if he is going to display the view on the user page of each student (ex: /user/10), he needs to add the contextual filter of uid. Why don't you add another answer I don't think this is worthy of being a standalone answer.
    – No Sssweat
    Feb 6 '16 at 8:11
  • just to clarify further, I am talking about if he creates a block view, and not a page view.
    – No Sssweat
    Feb 6 '16 at 8:18
  • OK, now I get it, interesting thought! I'll give you abitmore time to write it up as an answer anyway. Otherwise later on today I might include it in my answer anyway. Other option: "suggest an edit" to my answer (I authorize you to include those comments)! Feb 6 '16 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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