{"id":89,"date":"2021-03-17T11:01:03","date_gmt":"2021-03-17T11:01:03","guid":{"rendered":"https:\/\/helpdesk.spider-themes.net\/docs\/docy-wordpress-theme\/using-shortcodes\/conditional-content-conditional_data\/"},"modified":"2021-03-17T11:01:03","modified_gmt":"2021-03-17T11:01:03","slug":"conditional-content","status":"publish","type":"docs","link":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/docs\/docy-wordpress-theme\/using-shortcodes\/conditional-content\/","title":{"rendered":"Conditional Content [conditional_data]"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Conditional Content?<\/h2>\n\n\n\n<p><strong>Conditional content <\/strong>allows you to show or hide certain parts of a page depending on the visitor\u2019s selection. This makes your documentation more dynamic\u2014perfect for showing different commands, shortcuts, or instructions for different operating systems.<\/p>\n\n\n\n<p>On the Docy theme demo, you\u2019ll notice an OS selection dropdown in the right sidebar of a documentation page. When users choose an option, the displayed content changes accordingly.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e81426af78c&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e81426af78c\" class=\"aligncenter size-full wp-lightbox-container\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1774\" height=\"752\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes.webp\" alt=\"Docy Documentation Site Conditional Content Using ShortCodes\" class=\"wp-image-9992\" srcset=\"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes.webp 1774w, https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes-300x127.webp 300w, https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes-1024x434.webp 1024w, https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes-768x326.webp 768w, https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-content\/uploads\/sites\/99\/2024\/02\/Docy-Documentation-Site-Conditional-Drop-Using-ShortCodes-1536x651.webp 1536w\" sizes=\"(max-width: 1774px) 100vw, 1774px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Enable the Conditional Dropdown<\/strong><\/h3>\n\n\n\n<p>You can display conditional contents in your documentation using this dropdown. The visitor to your website can see alternative information based on the drop-down value selected.<\/p>\n\n\n\n<p>Navigate to [direction]EazyDocs &gt; Settings &gt; Doc Single&gt; Right Sidebar[\/direction]. From there, you will find the drop-down options (which are marked in the screenshot below). You can create\/add drop-down list items from this option.<\/p>\n\n\n\n<p>Use the <code>[conditional_data dependency=\"dropdown_title_value\"]] Content [[\/conditional_data]<\/code> shortcode to display the conditional contents on your documentation. For example, you can use this dropdown to show different keyboard shortcuts for different OS. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Video Tutorial<\/strong><\/h3>\n\n\n\n<p>Watch the video guide to learn how to create, set up, and apply conditional content step by step.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Display Conditional content in Docly WordPress theme\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/muNTEVSShfs?start=87&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Conditional content lets you display different information based on user selection. With Docy theme\u2019s OS dropdown, users instantly see relevant commands. Enable this feature through EazyDocs settings and the provided shortcode.<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":86,"menu_order":23,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-89","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/docs\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":0,"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/docs\/89\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/docs\/86"}],"wp:attachment":[{"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/arolax.crowdytheme-demo.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}