Needs work
Project:
Simplenews
Version:
3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2021 at 13:31 UTC
Updated:
22 Jan 2023 at 05:39 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
mohit.bansal623 commentedRemoved description as per the requirement.
Comment #4
mohit.bansal623 commentedComment #5
aritrika.d commentedI have uploaded before and after image of applying the patch,the patch works fine
Comment #6
tr commentedRemoving the base field description from the entity like the patch in #2 does is absolutely the wrong way to do this. The field descriptions are used in more than just that one place, you know, and are essential parts of the entity definition. If you think *showing* the description in that one particular place is "useless", then that's something you can easily customize on your site - no change to this module is necessary. Just hook_form_alter() the form or the block or the entity that displays the description. Or even just use CSS to hide it. Any of these ways is only a few lines of code. Regardless, I don't know why you would want to throw away descriptive text - that just increases the chance that a user enters the wrong thing.
I recommend closing this as "won't fix" because this sort of customization shouldn't be done in the simplenews module.
Comment #7
vikashsoni commented@mohit.bansal623 this patch is working fine sharing screenshot for reference ....
Comment #8
robcarrI agree that this should be something that should be done in the theme layer. However, there's not much guidance on how to achieve this.
The 3.x version doesn't provide a template for the signup block/form that can be overridden (see #3259543: Documentation wrong for Simplenews Block Theming). Currently struggling to use
hook_form_alter()to change values for the description and add placeholder text; I would have expected the following to work:But it doesn't. Whilst the Form ID is correct, I'm not sure I'm targeting the correct input element
(have also tried$form['mail']['widget']['#description']and assorted variations). So it looks like only way to deal with customisation is the very 'hacky' way at #2Comment #9
robcarrWhat a difference a cup of tea makes. The following code in your custom theme allows you to override the input field attributes on the signup block:
EDIT: The
simplenews-signupsuffix to the form ID comes from the unique ID when you add the block to your region/page via the UI.Comment #10
portulacaThank you @robcarr for posting this! It works!
For anyone also looking to change the Submit button text and adding a title attribute to it: