{"id":16324175,"date":"2022-12-28T00:58:00","date_gmt":"2022-12-28T00:58:00","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/nested-content-toggle\/"},"modified":"2022-12-28T00:58:00","modified_gmt":"2022-12-28T00:58:00","slug":"nested-content-toggle","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/nested-content-toggle\/","title":{"rendered":"Nested Content Toggle"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I am using Content Toggle for FAQ&#8217;s and that part works fine. However, I wanted to put &#8220;References&#8221; at the bottom of the first panel and not display the actual references until someone clicks on &#8220;References.&#8221; Theoretically, if I inserted a Content Toggle box inside the first FAQ, I could get exactly what I want.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have all panels closed by default when the page first loads and that&#8217;s working fine. The problem is that the &#8220;References&#8221; Content Toggle is ALWAYS open as soon as its parent&#8217;s FAQ is open after the page first loads. If I click on it to close it, it works fine. If I click the parent closed after I click &#8220;References&#8221; to close and then reopen the parent, &#8220;References&#8221; is still closed, which is perfect. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have the settings on the child set to &#8220;Collapsed&#8221; and &#8220;Collapse on Mobile.&#8221; For the parent, &#8220;Collapsed&#8221; is also set but &#8220;Collapse on Mobile&#8221; is not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When I inspect the HTML, the div attributes for the child for data-mobilecollapse and data-desktopcollapse are both set to &#8220;true&#8221;, yet the panel is showing. The div tag around the panel does not have the &#8220;ub-hide&#8221; class until I close it manually. In fact, it doesn&#8217;t have &#8220;ub-hide&#8221; on it when the page first loads either, even though the parent panel DOES have the &#8220;ub-hide&#8221; class initially. I think if &#8220;ub-hide&#8221; were added to the child when the page loaded, everything would work perfectly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I could fix this with my own JavaScript but if you&#8217;d like to fix it, I would be most grateful!<\/p>\n","protected":false},"template":"","class_list":["post-16324175","topic","type-topic","status-publish","hentry","topic-tag-content-toggle","topic-tag-nesting"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16324175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16324175\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16324175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}