Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Do you have a sample of a shared component taking a parameters from a parent component?

Avatar

Avatar
Validate 1
Level 1
JoelLucuik
Level 1

Like

1 like

Total Posts

52 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
JoelLucuik
Level 1

Like

1 like

Total Posts

52 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
JoelLucuik
Level 1

18-11-2020

I want a component that has a left side of 

Option1 (Anchor)

Option2 (anchor)

 

Right side is the form you see from the selection on the left.

 

I have this working using grid-item on the left, and on the right:

 

<div id="form" class="grid-item">
<p data-sly-test="${request.requestParameterMap['section'][0].toString == 'option1'}">
<article data-sly-resource="/content/forms/af/project/option1"></article>
</p>
<p data-sly-test="${request.requestParameterMap['section'][0].toString == 'option2'}">
<article data-sly-resource="/content/forms/af/project/option2"></article>
</p>
</div>

 

What I would like is a component on the left that can take ['option1 label", "option1 link", "option 2 label", "option2 link"]

or something similar 

 

Overall Question: Can I pass args to a component if the behaviour will likely be common?

 

Thanks

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

278 likes

Total Posts

1,101 posts

Correct Reply

181 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

278 likes

Total Posts

1,101 posts

Correct Reply

181 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile
Mayank_Gandhi
Level 10

24-11-2020

@JoelLucuik I don't get the use case. Do you want to share more details or some screenshots?