Hi, If we want to show/hide both tabs and fields in AEM, based on the style selected for a component - content-management-system

Like for my one component there a two styles added , if style one is selected then I have to hide 1 field in cq:dialog and if style 2 is selected then I have to show that field

Is the style mentioned above, is a dropdown within same dialog? If yes, there are numerous examples explaining how to implement Show/Hide of dialog fields. Please check here, here, here, here.
Basically idea is on the dropdown field, add a class cq-dialog-dropdown-showhide and a property cq-dialog-dropdown-showhide-target with a value of class selector unique to component. Then by defining property showhidetargetvalue on the element, selecting the dropdown will show/hide respective properties.
If the style you mentioned is the style system applied using brush icon, it is not OOTB. You ll need to add an authoring clientlib and implement logic to hide specific dialog field based of style system applied.
IMO style system is presentational, only to apply skin to the component. It should not drive business logic of allowing dialog properties. As simplistic, maybe allow authors to enter all allowable fields at dialog and using JS, you may consume / not, the dialog properties.

Related

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

Show/Hide different fields Based on dropdown value in Magnolia content app?

I have created a content app in which I am able to show and hide different fields using radio buttons but how to Show/Hide different fields Based on the dropdown value in Magnolia content app?
For radio button and fields i used below class info.magnolia.ui.form.field.definition.SwitchableFieldDefinition
and for transformer class i used
info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
but now i want to use
info.magnolia.ui.form.field.definition.SelectFieldDefinition
instead of SwitchableFieldDefinitionbut I am unable to do so with any of the transformer class.
I also searched and found similar thread here but it has the incomplete answer!
According to https://documentation.magnolia-cms.com/display/DOCS/Switchable+field you can define a property named "selectionType" with the value "select".
I haven't tested that though.
If you have a look in SwitchableFieldDefinition, it looks promising though, because there's really a property with that name and it just defaults to "radio" but can be overwritten.

show and hide tabs dynamically in touch ui -AEM

I have a requirement, where I need to show few tabs on selection of a value from a drop down.
I have done this in classic UI. But not sure how to proceed for Touch UI. I know that we can use JQuery, Can anyone let me know the approach I can use.
Its fairly simple, look at the OOTB List Component /libs/foundation/components/list. The selection dropdown is defined - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom, look at property class and cq-dialog-dropdown-showhide-target these are used to manage hide and show.
Now from here look at the dropdown values under - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom/items these values trigger the hide and show mapping to property showhidetargetvalue as in /libs/foundation/components/list/cq:dialog/content/items/column/items/setDescendants

AEM/CQ5 how to share component values?

I want to have a header component that is shared across multiple page rendering components. The header component has a text label. How do I make the value of this text label available to all page components.
Do I have to make the path in the <cq:include> to a common format?
Design mode, if properly understood, can work quite well. However, it doesn't replicate content in the same manner as page activation, and thus can be confusing for your authors. Also, the sharing model is limited to the exact page type - which may or may not be the granularity you desire.
From CQ5's Best Practices (https://dev.day.com/docs/en/cq/current/developing/developing_guidelines_bestpractices.html), they strongly encourage the paragraph system (iparsys to inherit/share). iparsys named the same can be shared across different page templates (while design mode will only apply to a single template type).
I can archive that by creating a design dialog that is similar to dialog (http://dev.day.com/docs/en/cq/5-6/developing/components.html#Dialogs) under the header component. You add the text label field to design dialog. And to enter value for the field, you switch the page to the design mode and click on Edit button on the top of the component. The entered value will be available to all pages that contain the header component.
Note: design dialog will be named as design_dialog
This functionality is now offered in ACS AEM Commons as Shared Component Properties - http://adobe-consulting-services.github.io/acs-aem-commons/features/shared-component-properties.html
Supports standard content activation and internationalization (values stored below the homepage) and anything else you would expect from content.
If the component is baked in the template(i,e page rendering component), yes you can make the <cq:include> path attribute to point to some common place where the data for this is stored and all the pages irrespective of , type of the template can get the values configured.
You can create header component and then include it using <cq:include> in base template/page. This base template/page will be inherited by all other templates. This way the header once configured in base page is availble through out different templates/page components.
If the goal is to share "across multiple page rendering components" the design dialog will only help if the page share the same rendering component.
If you want to have the header component displayed in a page and all its subpages, then you should use iparsys.
If you just want to reuse the properties of that header component, then it needs to have a fixed path (cq:include in a page component) and then you can reference the properties you need in other page rendering components. I would not suggest that approach since it breaks the idea of having a component. Everything becomes tightly coupled.
What you could also do is save those properties at the page level (some top parent page) and then use InheritanceValueMap in the subpages to read those properties.

Using a jQuery tooltip plugin to display Custom Taxonomy descriptions

I have a Custom Taxonomy called groups as part of my species Custom Post Type.
On the front-end of my website, each parent Group displays in a box, with a title and a description.
The children of said parent Group then display as single line <li>.
I would like to use a JavaScript plugin to display the description of each of these children when a user hovers over the link. For example, hover over "Hatchetfishes" and see the description for that Group, which might be "All fishes from the genera Gasteropelecidae".
I've had a look at ClueTip and I like the styling/simplicity of the plugin, so if possible, I'd quite like to use that. I'm totally open to using others though, as long as they're based on jQuery and are lightweight.
What would be the most efficient way of doing this? I have 7 parent Groups and 39 children on one page; no descriptions are longer than 20 words.
Thanks in advance,
Within the <li> that holds the children, put the description of the children. Default behavior for these should be to not display, and they should presumably all have the same class. You can then set another class (or just apply css directly with jQuery) to make these display.