Nested lightning components in Salesforce communities - salesforce-lightning

Salesforce communities provide native lightning components with the capability of allowing a user to drag and drop components into them. Not all components are allowed (i.e. A tab component cannot contain another tab component, but can contain a list view component). I have this very simple component:
<aura:component implements="forceCommunity:availableForAllPageTypes,forceCommunity:layout" access="global" >
<aura:attribute name="detail" type="Aura.Component[]">
<p>default paragraph1</p>
</aura:attribute>
<aura:set attribute="detail"></aura:set>
Default value is:
{!v.detail}
</aura:component>
This component implements forceCommunity:layout, so I can create a page using it as a layout. When I do, components can be dragged in to where the '{!v.detail}' is. When I drag the component into an already-existing layout, I lose that functionality. Is there any way to do this?

You need to edit template settings rather than drag it into the community builder.
If you want to add them programmatically, you'll need to do that inside a lightning component.

Related

in aem in touch ui using sightly to a parsys component if i add some image or anything next parsys should be after that one not below it

in aem in touch ui using sightly if I add a parsys component with some width(ex:30%) and after adding some component to it next parsys should come after that one not below of the previous component. How can I do that one?
There is not something like "fixed-fluid layout" in AEM.
You should create a layout before drop the components, you can use column control to achieve this, take a look to the documentation: https://helpx.adobe.com/experience-manager/using/custom_columns.html

Using built in AEM form

The form component in AEM and all other form related components mandate that it should be used under parsys component (by dragging and dropping). When I use these form components without a parsys as their parent, are not behaving as expected for ex: form end component does not show submit button even though i have checked the option to show submit button.
Question: I want to use the form components but I don't want to use drag and drop. I want to create a reusable form component with predefined fields. Any way to achieve this?
Finally after a lot of searching, I found the best solution here :
http://versatileankur.blogspot.in/2014/11/component-with-default-components-in-cq5.html

How to build an AEM parsys that by default places new components at the top instead of bottom?

Is there a way to build/configure a parsys in AEM 6.0 such that when users drag new components from the sidekick, that the parsys will show a slot to add a new component at the top instead of the bottom (Referring to the box labeled "Drag components or assets here")? For example, I have a parsys with a list of articles and the articles are by default shown in descending order. When a user goes to add a new article I'd like them to by default add a new one at the top of the list in the parsys and not have to add to the bottom then re-order all the way from the bottom up. Is this possible in AEM 6.0?
Not sure if i understand your question correctly, but to explain how parsys work:
Parsys is a placeholder which allow authors/editors to drag and drop
components.
Editors can drop a new component before/below an existing component, which means parsys is already flexible enough to add new component anywhere.
Considering Your article list example, by forcing new component always on top, you will loose feature#2. I would recommend following options:
Use OOB parsys and handle this by governance.
or Create a component which render list of articles in descending order.

Cq Parsys with a Parsys

I would like to create a component which is a parsys and can hold some specific components only. I have copied the parsys component from the foundation, and create a new component drag-drop-parsys, but when I drag it on the page, that on the parsys, I can see the green-surronding bar for "drag-drop-parsys". Can some one please let me know what should I do.
Parsys with in Parsys (drag-drop-parsys) and which can hold specific components.
Thanks for all your help.
-MG
Could you clarify why you are created an entirely new paragraph system? Generally to limit certain components to a certain parsys, you would use the "Design", a configuration that specifies exactly that. You specify in the design that X, Y, and Z components (or component groups) are available in any parsys named "your parsys name" per page component.
Here's the documentation:
http://dev.day.com/docs/en/cq/current/developing/designer.html
One solution would be to create a NEW component "my-parsys" that inherits from the system parsys component. Then the new component could restrict allowedChildren to the desired set of draggable components. Theoretically, this wouldn't require any JSP's - just the settings around your draggable parsys.
NOTE: generally, it doesn't make sense to drag a parsys directly into another parsys - that is just nesting lists of components. However, we have created "wrapper" components that themselves may have their own parsys for components inside themselves.

Component without a dialog won't display in Sidekick

If a component is created, but a dialog.xml file isn't included within it, it will not show as available within the Sidekick, even if enabled in Design mode, and with a Component Group specified — why is this?
If you add a cq:editConfig node to the component it will show up in the sidekick, after being enabled in the design dialog of the parsys, without having a dialog.
As reference: http://dev.day.com/docs/en/cq/5-3/developing/components.html#Components and their structure
dialog boxes are meant for dynamically adding content to the components.
if there is no dialog box in a component there is no reason for component to display in sidekick .
u can directly hard code the component like this.
<cq:include path="par0" resourceType="/apps/...." />
Have you gone into the design portion to allow your component? I've often created a new component, and been unable to add it simply because I forgot to allow it in the design mode on that page.
EDIT
Good point - I do believe a dialog.xml file is required for it to show up in the sidekick. Otherwise you have to hard code the include of your component where you need it. I would suggest adding a dialog.xml file, even if it is only for the reason of showing it in the sidekick, so you can add it dynamically to different pages.