CRUD
CRUD copied to clipboard
Put action name in heading
WHY
See #4901
BEFORE - What was wrong? What was happening before this PR?
The "create" and "edit" pages had their headings set to the model plural (e.g. "Monsters") and the subheading to the current action (e.g. "create new monster").
AFTER - What is happening after this PR?
- The heading will be set to the current action (unless something is set in
$crud->getHeading()
) - The subheading will be empty by default, unless something is set in
$crud->getSubheading()
HOW
Switched the placeholders in the template code
Is it a breaking change?
No
How can we test the before & after?
Create or edit any model
The inspection completed: No new issues
Hello @pekka thanks for the PR and the explanation 🙏
I agree with some of your arguments:
- It's better to read
Edit Monsters
thanMonsters Edit Monsters
for screen readers. -
Monsters Edit Monsters
is redundant, indeed.
What I don't like is that Edit
word in this PR has the same emphasis as the "heading" of the page.
To fix the above mentioned issues should we just get rid of the monsters
word in the subheading, making it only:
Monsters Edit ?
Would that still be an issue for screen readers ? Redundancy is removed so maybe that works ?
@tabacitu what do you think ?
Cheers
To fix the above mentioned issues should we just get rid of the
monsters
word in the subheading, making it only: Monsters Edit ? Would that still be an issue for screen readers ? Redundancy is removed so maybe that works ?
Personally, I think describing the current operation in plain text would work best! But, your decision, and trivially easy to customize anyway 👍
I can amend the PR once it's decided.
Hey @pekka 10 years later ... 🫨
This PR as is I think will not get merged, but I like the idea myself.
I thought about a solution for this here: #5566 not sure if it's a good idea or not. If you have an opinion about it, let me know 🤷♂️
Thanks again for taking time to submit the PR 🙏