0
votes

I wish to take the component libs/foundation/components/parsys/colctrl/... and modify its text so that I can use it for css tabs instead. I recreated it as apps/-site-/components/content/tabsys/ (and all it's subfolders/components/etc. The only thing I didn't change was in tabsys/tabctrl/virtual/2tabs/cq:editConfig/cq:formParameters (same for 3tabs/ as well):

sling:resourceType = foundation/components/parsys/colctrl
layout = 2;cq-colctrl-lt0

In the sidekick I now have a Tabs component option, with the same options as Columns. However, when I drag any of the Tabs into the content area, I don't get any of the border content areas to drag content pieces into; only the Edit/Delete/New bar. When I click Edit I should have a dropdown for the number of columns I want to have (Columns component has it for reference). What am I missing?

1
Did you recreate it, or copy it? Often, node types are a significant and overlooked aspect - if they are the wrong type it can cause things to misbehave. - antonyh
I copied it and changed titles/descriptions accordingly. - justacoder
you could try adding ?debug=layout to the page url; it gives information on each resource and type in play for the page. This might give you a helpful clue. - antonyh

1 Answers

1
votes

I ran into this same issue, and the reason for this seems to be that the ParagraphSystem class used by the parsys component only parses/generates the columns/containers if the sling:resourceType of the content node ends in "/colctrl".

  private String colCtrlSuffix = "/colctrl";
  if (res.getResourceType().endsWith(this.colCtrlSuffix)) { /*creates columns*/ }

In your example, the tabctrl should have a reference to the Super type:

  sling:resourceSuperType = "foundation/components/parsys/colctrl"

Secondly, if tabctrl were renamed to colctrl then the ParagraphSystem would attempt to parse the columns based on the number specified in first part of the layout attribute and create the additional content nodes for each column.

If the ParagraphSystem class looked for "-colctrl" rather than "/colctrl" it would have allowed for customized components like "my-colctrl". Instead, I guess we need to use folders to avoid naming collisions. (i.e., apps/-site-/components/content/tabsys/colctrl)