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

entry.linkItField.anything not working #70

Open
zachphillips opened this issue Apr 29, 2017 · 4 comments
Open

entry.linkItField.anything not working #70

zachphillips opened this issue Apr 29, 2017 · 4 comments

Comments

@zachphillips
Copy link

It's treating the return of anything from entry.linkItField.url or .getUrl() as trying to pull an element from a string variable: Impossible to access an attribute ("url") on a string variable ("").

I'm pretty sure I've followed the instructions exactly. My LinkIt field is part of a Matrix.

<a href="{{ block.buttonLink.url }}" class="btn btn-primary btn-color">{{ block.buttonText }}</a>

I've tried it for LinkIt fields to custom urls, entries, everything.

@Bandit
Copy link

Bandit commented Jun 27, 2017

I'm using this in exactly the same way and it works fine - double check everything is set up correctly?

[...] href="{{ content.leftButtonLink.url }}" target="{{ content.leftButtonLink.target }}">{{ content.buttonText }} [...]

@helleholmsen
Copy link

I'm having the same problem. Did you solve it @zachphillips ?

@zachphillips
Copy link
Author

zachphillips commented Nov 14, 2017 via email

@brandondeweese
Copy link

brandondeweese commented Jan 18, 2018

Hi..the documentation for this sucks..but I've finally found an answer. Don't know if it's best practice or not.
Wrap it in:

{# if block.buttonLink.type is defined #}
<a href="{{ block.buttonLink.url }}" class="btn btn-primary btn-color">{{ block.buttonLink.text }}</a>
 {% endif %}

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

5 participants