Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By nhero on
I know I can use '#prefix' to add text above my form but I wanted to know if there are other ways to do this as well.
Comments
Use the value type
Yes, you just create a form field that's of type value.
So something like so:
I tried this technique but
I tried this technique but the text isn't showing up.
hi
You can do this by using prefix. Make sure you return the form and cal the form to print.
The original response had the
The original response had the right idea, except that type 'value' means that the data is never sent to the browser. You can use this:
This is actually 'type' markup, but type 'markup' is the default, so you don't actually need to add that. So the above is shorthand. But if you do want to add a type, you can use this:
But both sets of code will do the exact same thing.
thanks, that is exactly what
thanks, that is exactly what I wanted to do.
What file is this in and
What file is this in and where do I find it? (Sorry I am new)
Nevermind, found it!
Nevermind, found it!