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

Ability to add a helper inside of a foreach #16

Open
risteardc opened this issue Mar 14, 2017 · 2 comments
Open

Ability to add a helper inside of a foreach #16

risteardc opened this issue Mar 14, 2017 · 2 comments
Assignees

Comments

@risteardc
Copy link

I have a foreach on my component and I need to have the ability to conditionally add some markup based in whether it exists in the json file.

So if json object exists publish out whatever.

I've attached a screenshot as I can't add the code.

screen shot 2017-03-14 at 13 13 32

Adding HTML.Esists doesn't work in this instance.

@rsleggett rsleggett self-assigned this Mar 14, 2017
@rsleggett
Copy link
Contributor

Workaround is to use

ModelHelper.Exists(item, "textGroupsCta")

@rsleggett
Copy link
Contributor

Improvement would be to add an overload to Html.Exists to support passing a model for consistency.

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

2 participants