Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render Refactoring #8

Open
wants to merge 2 commits into
base: 8.x-2.x
Choose a base branch
from
Open

Conversation

marcus-n3rd
Copy link

Turns out that I was wrong with PR #4, as it never actually processed the render class. After stepping through the module's current render process and comparing it to others (image field's namely). I decided it could be simplified and still operate as it has been.

I feel this will innately solve the same problems that PRs #2, #3, and #5 are trying to solve.

I doubt this is the final answer, but I think this should be a good start.

Removed the module file and moved the view argument parsing to the ViewfieldDefaultFormatter class.

Adding a theme element seemed excessive for a couple of HTML element classes, so `viewfield_formatter_default` and its twig file was removed.

Recursion prevention could be handled in the ViewfieldDefaultFormatter::prepareView() method. (WIP, likely next commit).
Also, renamed machine name from `viewfield_default` to `viewfield_formatter`. Note that I personally debated having it simply `viewfield` to match the naming conventions of core, the image field in particular.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant