1

I have created a custom module that can add an entry into my own created tables. However, I need to display the contents of that table into the admin, a table like view. Like this one in the picture:

enter image description here

Can you point me to the correct documentation or what is this called?

Thanks.

1

1 Answer 1

0

You can create such tables with the Views module.

You need Views if:

  • You like the default front page view, but you find you want to sort it differently.
  • You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
  • You use /tracker, but you want to restrict it to posts of a certain type.
  • You like the idea of the 'article' module, but it doesn't display articles the way you - like.
  • You want a way to display a block with the 5 most recent posts of some particular type.
  • You want to provide 'unread forum posts'.
  • You want a monthly archive similar to the typical Movable Type/Wordpress archives that displays a link to the in the form of "Month, YYYY (X)" where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.
10
  • Any solution not using an another module? As I was creating a custom module, I want to write one from scratch. Commented Mar 27, 2014 at 9:14
  • Sure, Drupal is written in PHP so you can do whatever you need to. I wouldn't recommend it though, Views is the standard solution for this. Everything's already written for you.
    – Clive
    Commented Mar 27, 2014 at 9:15
  • Yes but I want to know what hook does this? Say for example I generated a form using hook_form. Commented Mar 27, 2014 at 9:17
  • @Clive : Op is talking about fetching records from custom table.. I don't think views will support it.. Correct me if iam wrong..
    – Anil Sagar
    Commented Mar 27, 2014 at 9:17
  • @AnilSagar You're wrong ;) hook_views_data(). Leandro, there's no single hook that will just make you an HTML table on-screen. There are multiple disciplines involved, and we can't tutor you through those in a single question here I'm afraid. Try breaking your tasks down and attacking each one individually. To get you started, your first task is creating a page containing custom content. See How should I implement hook_menu() for the answer
    – Clive
    Commented Mar 27, 2014 at 9:20

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.