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

[bug] linkItField.linkAttributes exists in the documentation, but not in the code #104

Open
tomdavies opened this issue Sep 20, 2022 · 1 comment
Assignees

Comments

@tomdavies
Copy link

The readme file refers to it being possible to access a linkAttributes property:

 {{ entry.linkItField.linkAttributes }}

but that doesn't actually work:

Twig Runtime Error – [Twig\Error\RuntimeError](http://twig.sensiolabs.org/api/2.x/Twig/Error/RuntimeError.html)
Calling unknown method: presseddigital\linkit\models\Entry::linkAttributes()

Being able to access all the generated link attributes (inc href) would be super useful for when you need to build the inner HTML of a link manually, but still want to access attrs like target etc etc. Verb Navigation does this well.

Feels like this would be pretty easy to add - happy to PR if it's likely to be accepted

@ben-callaway
Copy link
Collaborator

Thanks for raising @tomdavies. We'll look to add some additional helper methods, getAttributes() and getAttribute(‘name’).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants