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.
"Subscribe to newsletter" headline should be left out, and then let the user give the block a headline and print that instead.
Comment | File | Size | Author |
---|---|---|---|
#8 | example-formtitle.JPG | 41.81 KB | KoCo |
Comments
Comment #1
dboulet CreditAttribution: dboulet commentedIf I understand correctly, you can do this already—just enter your headline into the 'Block Title' field on the block settings page.
Comment #2
levelos CreditAttribution: levelos commenteddboulet is correct
Comment #3
lsolesen CreditAttribution: lsolesen commentedYou are right. But if I leave the title blank it default to "Subscribe to newsletter", which does not make sense. I do not want a title on the block, and I should decide, not some default :)
Comment #4
dboulet CreditAttribution: dboulet commentedHi lsolesen, that is how all blocks work in Drupal—they all have default, or "suggested" titles. You can turn it off by entering "<none>" as the title for the block.
Comment #5
lsolesen CreditAttribution: lsolesen commentedDoh!
Comment #6
KoCo CreditAttribution: KoCo commentedIt still is somewhat valid, if you want do downsize the form.
In the list settings page, the label is required. Which acts as title for the form.
When using the form in a block, you can choose the block title.
But many themes use different css tags and styling for different titles.
In this case the title for a block or form could be totally different.
A lay-out with several blocks in a row, ...
Off course, you could css the title away, but wouldn't it be nicer to leave out un-needed html code.
So, Is it possible to create a simple switch, that triggers some form hook to delete the title?
Sorry, but I'm fairly new at working with entities and the form API.
If it's too much of a hassle, please kill the status of this issue again.
thx
Koen
Comment #7
dboulet CreditAttribution: dboulet commentedHi Koen, please see my comment in #4. Does that not accomplish what you are wanting?
Comment #8
KoCo CreditAttribution: KoCo commentedHi dboulet,
Actually it doesn't, both elements get different css classes.
A block title is a standardized element throughout a Drupal site.
The form title maybe styled to look like it, but that's usually a lot of hassle.
I attached a simple example, when blocks are in a row.
The standardized block title would suffice and lay-out nicely with blocks next to it. The form title would be overkill here.
Off course the simplest of solutions is to set style 'display: none;' on the form title id.
So this is definitely not a major issue ;-)
thx
Koen
Comment #9
Perignon CreditAttribution: Perignon as a volunteer commented