{"id":17657,"date":"2015-02-27T17:49:23","date_gmt":"2015-02-27T12:19:23","guid":{"rendered":"https:\/\/2thenew.online\/blog\/?p=17657"},"modified":"2015-02-27T17:49:23","modified_gmt":"2015-02-27T12:19:23","slug":"hide-a-cq-parsys-in-edit-mode","status":"publish","type":"post","link":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/","title":{"rendered":"Hide a CQ parsys in edit mode"},"content":{"rendered":"<p>Often, a situation is encountered in CQ where we have a number of parsys on our page and it is\u00a0required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that particular tab while the parsys for all the other non active tabs should be hidden.<\/p>\n<p>If my parsys is wrapped by a container div something like this.<\/p>\n<p>&lt;div class=&#8221;genericTabContent&#8221;&gt;&lt;cq:include path=&#8221;par&#8221; resourceType=&#8221;foundation\/components\/parsys&#8221; \/&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>Then, calling the .hide() method on the div doesn&#8217;t hide the parsys. Rather, the parsys is visible floating somewhere on\u00a0the page making the authoring experience very tough.<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2015\/02\/parsys1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17661\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/02\/parsys1.jpg\" alt=\"parsys1\" width=\"579\" height=\"250\" \/><\/a><\/p>\n<p>All attempts to hide the parsys through CSS seem to fail.<\/p>\n<p>A possible solution is :<\/p>\n<p>var parsysComp = CQ.WCM.getEditable(&#8220;path to the parsys&#8221;);<br \/>\nparsysComp.hide(); \/\/ makes the parsys visible<br \/>\nparsysComp.show(); \/\/ hides the parsys<\/p>\n<p>To get the path to the parsys, the current node path can be fetched on our jsp page:<br \/>\n&lt;div id=&#8221;currentNodePath&#8221; class=&#8221;${currentNode.path}&#8221;&gt;&lt;\/div&gt;<\/p>\n<p>Once the current node path is known, this code snippet would work:<br \/>\nvar parsysComp = CQ.WCM.getEditable((&#8216;#currentNodePath&#8217;).attr(&#8216;class&#8217;)+&#8221;\/par&#8221;);<\/p>\n<p>Hope this was helpful!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often, a situation is encountered in CQ where we have a number of parsys on our page and it is\u00a0required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that [&hellip;]<\/p>\n","protected":false},"author":162,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":12,"footnotes":""},"categories":[1],"tags":[4847,1657,1246,1655,1656],"class_list":["post-17657","post","type-post","status-publish","format-standard","hentry","category-technology","tag-aem","tag-aem-components","tag-cq5-6","tag-hide-parsys","tag-hide-parsys-in-edit-mode"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Rima Mittal\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Hide a CQ parsys in edit mode | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Hide a CQ parsys in edit mode | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#article\",\"name\":\"Hide a CQ parsys in edit mode | TO THE NEW Blog\",\"headline\":\"Hide a CQ parsys in edit mode\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rima-mittal\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2015\\\/02\\\/parsys1.jpg\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#articleImage\"},\"datePublished\":\"2015-02-27T17:49:23+05:30\",\"dateModified\":\"2015-02-27T17:49:23+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#webpage\"},\"articleSection\":\"Technology, AEM, aem components, CQ5.6, hide parsys, hide parsys in edit mode\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#listItem\",\"name\":\"Hide a CQ parsys in edit mode\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#listItem\",\"position\":3,\"name\":\"Hide a CQ parsys in edit mode\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rima-mittal\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rima-mittal\\\/\",\"name\":\"Rima Mittal\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/552b33f06953183358cd42511dfc3f032c3929a55e68c3098e753d32207e2d5a?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Rima Mittal\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/\",\"name\":\"Hide a CQ parsys in edit mode | TO THE NEW Blog\",\"description\":\"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\\\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hide-a-cq-parsys-in-edit-mode\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rima-mittal\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/rima-mittal\\\/#author\"},\"datePublished\":\"2015-02-27T17:49:23+05:30\",\"dateModified\":\"2015-02-27T17:49:23+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Hide a CQ parsys in edit mode | TO THE NEW Blog","description":"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that","canonical_url":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#article","name":"Hide a CQ parsys in edit mode | TO THE NEW Blog","headline":"Hide a CQ parsys in edit mode","author":{"@id":"https:\/\/2thenew.online\/blog\/author\/rima-mittal\/#author"},"publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2015\/02\/parsys1.jpg","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#articleImage"},"datePublished":"2015-02-27T17:49:23+05:30","dateModified":"2015-02-27T17:49:23+05:30","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#webpage"},"articleSection":"Technology, AEM, aem components, CQ5.6, hide parsys, hide parsys in edit mode"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.online\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/2thenew.online\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#listItem","name":"Hide a CQ parsys in edit mode"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#listItem","position":3,"name":"Hide a CQ parsys in edit mode","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.online\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.online\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.online\/blog\/author\/rima-mittal\/#author","url":"https:\/\/2thenew.online\/blog\/author\/rima-mittal\/","name":"Rima Mittal","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/552b33f06953183358cd42511dfc3f032c3929a55e68c3098e753d32207e2d5a?s=96&d=mm&r=g","width":96,"height":96,"caption":"Rima Mittal"}},{"@type":"WebPage","@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#webpage","url":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/","name":"Hide a CQ parsys in edit mode | TO THE NEW Blog","description":"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.online\/blog\/author\/rima-mittal\/#author"},"creator":{"@id":"https:\/\/2thenew.online\/blog\/author\/rima-mittal\/#author"},"datePublished":"2015-02-27T17:49:23+05:30","dateModified":"2015-02-27T17:49:23+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.online\/blog\/#website","url":"https:\/\/2thenew.online\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Hide a CQ parsys in edit mode | TO THE NEW Blog","og:description":"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that","og:url":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/","og:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Hide a CQ parsys in edit mode | TO THE NEW Blog","twitter:description":"Often, a situation is encountered in CQ where we have a number of parsys on our page and it is required to show\/hide some of them on certain events. A typical use case is that of a Tabbed Component where the parsys associated with a particular tab needs to be shown only on click of that","twitter:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"17657","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 00:25:21","updated":"2024-02-29 09:34:09","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHide a CQ parsys in edit mode\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.online\/blog"},{"label":"Technology","link":"https:\/\/2thenew.online\/blog\/category\/technology\/"},{"label":"Hide a CQ parsys in edit mode","link":"https:\/\/2thenew.online\/blog\/hide-a-cq-parsys-in-edit-mode\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/17657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/users\/162"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/comments?post=17657"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/17657\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/media?parent=17657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/categories?post=17657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/tags?post=17657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}