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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to add parsys to Touch UI Tab Component

prashanth55
Level 3
Level 3

Hi,

AEM 6.3 Touch UI, How to create a tab component with multiple tabs having a placeholder(parsys) where author has ability to add multiple components to a particular tab. The newly added compoents are dynamic based on author. By default each tab must have a placeholder(parsys) for author to add content.


We were able to implement this tabComponent in ClassicUI with jquery events to have specific tabs selected and editable.


How to achieve the same for Touch UI. Please do share your suggestions on the same.

9 Replies
Arun_Patidar
Community Advisor
Community Advisor

Hi,

You can create a tab component with Multifield where you can add multiple tabs and each for each tab you can add title and other fields. Based on the items in the tab component, in HTL you can get all the tabs and add parsys for each tab and author can edit tab item directly on the page. they can drag and drop any component inside tab item parsys.

<div data-sly-resource="${tabItem.par @ resourceType='foundation/components/parsys'}" ></div>

prashanth55
Level 3
Level 3

Thanks Arun,

Similar approach we have taken for classic UI. But how we will  make sure author is able to switch tabs and add components to the particular tab in TOUCH UI. I think jquery events are not supported in edit mode in Touch UI now how to handle this

Arun_Patidar
Community Advisor
Community Advisor

Hi,

Yes, In edit mode you can show all tabs with content but in preview or disabled, It can work as you want.

prashanth55
Level 3
Level 3

Is going to preview mode to change tab for adding content a work around or adobe recommended approach.

Was thinking if there is an alternative solution to achieve instead of having authors to go to preview mode and come back to edit for adding contents to other tabs in a tab component.

Arun_Patidar
Community Advisor
Community Advisor

I am not sure if this a recommended way but there is a help article for same and they did exactly same as we discussed.

In Edit/Design mode the actual DOM of component is not available instead path of node is injected into DOM, This could be the reason things not work in Edit mode as in preview mode.

I think you can go with below approach.

Creating a Tab layout component for Adobe Experience Manager

smacdonald2008
Level 10
Level 10

Arun is correct - within each Tab - you can specify a parsys component.

smacdonald2008
Level 10
Level 10

I added a parsy component to the tab and now parsys component is showing up.

Tab-Par.png

That is how you can add an AEM component that contains tabs and where each tab uses a parsy that lets an author add components under each tab.

Arun_Patidar
Community Advisor
Community Advisor

Agree with Scott. Author just need to switch from edit to preview mode for selecting another tab for edit.

prashanth55
Level 3
Level 3

Thanks Arun Patidar​ & smacdonald2008​ for your responses its of great help.


Is curious to know if there is a workaround alternative way of switching tabs in edit mode to add content instead of going to preview and changing tabs.