Problem/Motivation
View PDF link on views doesn't have any styling. Add option to add CSS classes to "View PDF" link on views.
button button-action button--primary button--small
Steps to reproduce
- add a View PDF link to views, there are no classes applied to the link and no options to apply styling.
Proposed resolution
Add Css classes option to View PDF link and render link with CSS classes.
Remaining tasks
- update class EntityPrintViewsLink
- add tests
User interface changes
- extra field added to View PDF link configuration
API changes
- extra config field added to View PDF link config yml
Data model changes
- extra config field added to View PDF link config yml
Here before:

And after:

Config:

| Comment | File | Size | Author |
|---|---|---|---|
| after_config.jpg | 44.4 KB | ady1503 | |
| after.jpg | 11.75 KB | ady1503 | |
| before.jpg | 10.37 KB | ady1503 |
Issue fork entity_print-3502381
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ady1503 commentedComment #3
ady1503 commentedComment #4
ady1503 commentedI have little time now, the next option is to also transform the "View PDF" link into a button in the nodes.
It would be necessary to add this option in the module configuration form to be able to alter the link label per button with a CSS format.
When I have it I'm going to share it in case it works for someone.
If anyone wants to help, I say thank you in advance.
Thank you.
Comment #6
jannakha commented@ady1503 thanks for code you've provided. I've moved code to MR and updated task description.
Problem/Motivation
Hello.
I make some changes in code for make posibility to transform link "View PDF" in Views, from module to button.
Its must nicer view and for mi best option.
If you want add this is your module and your decision.
Here before:
And after:
And view:
I add sinitize function for security reazon.
And for default button classes is empty, user need add some css for button, in mi example I use Olivero default button css:
button button-action button--primary button--smallThanks for your module.
Gracias
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment #7
jannakha commentedComment #9
jannakha commentedComment #10
jannakha commented@ady1503 thanks for your work!
Re comment #4: create a new issue for optional css classes View PDF link on a node (to keep different features separate for easy testing/merging).
Comment #11
jannakha commentedComment #12
vladimirausMinor phpcs was fixed.
Everything else looks good and patch applies.
Thank you for contributing. 🎂
Comment #14
jannakha commentedmerged