for example: I want to hide sections in the component (example: I want to make the search bar optional in my custom header component). I know I can use either methods (with additional CSS for styling policies) but I would default to using component dialog properties as that's what I'm used to (does NOT necessarily mean it's the correct one)
thoughts?
Solved! Go to Solution.
Views
Replies
Total Likes
In your case, it's best to use the dialog. While hiding content with CSS can work, it only makes the content invisible to users, leaving it in the source code and still crawlable by SEO. If you want to completely exclude the content, don't generate it in the source at all.
Choosing between using the component dialog properties or the Style System in AEM depends on your specific use case and requirements. Here's a comparison of both approaches to help you decide which one is better for your situation:
Pros:
Cons:
Pros:
Cons:
Hi @jayv25585659 ,
Apart from centrality and all mentioned in other replies.
If we use css html element will be still there in dom(end user can easily change manipulate) , only display will be none.
However we use component properties with help of sightly it will render or remove the element itself.
So in general if we want to changes css(style) properties only irrespective of dom element we should go with style system.
If we want to hide/show html or functionality we should go with sightly as it will be secure.
Thanks,
Hi @jayv25585659
If your question is weather to use design dialog or CQ dialog for above configuration of your component, I would advise to keep this configurable at template level ( in component policy ) / Or if you are using experience fragment for custom header then you can keep it configurable at experience fragment itself ( using same component policy or component cq:dialog)
This is because you would want your change at all the pages that are created using a particular template or all the pages where the header experience fragment is present.
But if you want to make it specific to a page/ configurable at page level : then you can keep this as a checkbox in you component CQ dialog. Or if using experience fragment , control the visibility using authored id in experience fragment CQ:dialog.
Let me know if this helps.
In your case, it's best to use the dialog. While hiding content with CSS can work, it only makes the content invisible to users, leaving it in the source code and still crawlable by SEO. If you want to completely exclude the content, don't generate it in the source at all.
For making a feature optional, I would prefer to use:
I prefer styles to be used for UI aspects. But, enabling/disabling a functionality via configurations.
Views
Likes
Replies
Views
Likes
Replies