Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 882505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:26:13+00:00 2026-05-15T12:26:13+00:00

I have some view which lists my module table entries. What is the most

  • 0

I have some view which lists my module table entries.
What is the most elegant way to attach a form below the view to add record?
Waht I am trying to do know is:

  1. I created dedicated form in my module:

    function my_module_form_add_record($form_state) {
    form fields.....
    

    }

  2. I added to the view theme file:

    $add_form = drupal_get_form(‘my_module_form_add_record’);
    print $add_form;

But I do not like this solution for at least 2 reasons:

  1. I does not work …

2. Even if it worked – it is depended on the theme file! So if I change the theme – functionality is crashed.
I would like to find more elegant solution to attach form from custom module to the view.

I know of the existence of the “Views Attach” module but it has no option of adding custom forms.
I know also of the existence of the Views Embedded form (and I am usig it) but it is only useful if you want to add form to the every row.

Seems the must be some solution to add record from the view page!
Thanks you for help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:26:14+00:00Added an answer on May 15, 2026 at 12:26 pm

    you could use hook_views_pre_render:

    This hook is called right before the render process. The query has been executed, and the pre_render() phase has already happened for handlers, so all data should be available.

    Adding output to the view can be accomplished by placing text on $view->attachment_before and $view->attachment_after. Altering the content can be achieved by editing the items of $view->result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a users table, and a view table which lists some user ids...
When I have a table view with some sections which have their own headers
I have a view which lists some nodes and I want a custom output
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have created a View which prompts the user to input some records with
I have an action 'approval' that renders a view which displays some content from
I have a property in my view model which returns a constant under some
Hi All, I have a web-view in my application which displays some text with
I'm building an asp.net MVC 2 app. I have a list view which lists
I have an address block on a view which can swap some data if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.