I'm making a widget for Adobe Muse CC. I would like to hide/show a title and a logo inside a section html tag.
Initialize the component as a section tag with logo and title
Then, the user can :
- Hide or Show the logo
- Hide or Show the title
my-widget.mucow
<?xml version="1.0" encoding="UTF-8" ?>
<HTMLWidget name="toolbar" formatNumber="6" localization="none" creator="CreatorName" supportedSizePolicies="fixed,browserWidth" outputAsFixedHeight="true" defaultWidth="900" defaultHeight="32" isResizable="true">
<parameters>
<!-- Widget options -->
<builtIn name="width" value="900"/>
<number name="paddingToolbarLeft" min="0" max="50" step="5" defaultValue="10" label="Padding Left : "/>
<number name="paddingToolbarRight" min="0" max="50" step="5" defaultValue="10" label="Padding Right : "/>
<separator/>
<bool name="toggleLogo" label="Use Logo" defaultValue="noLogo">
<trueVal value="yesLogo">
// Show logo
</trueVal>
<falseVal value="noLogo" disableOptions="logoToolbar">
// Hide logo
</falseVal>
</bool>
<section label="Logo" expanded="true" name="logoToolbar" >
<file fileTypes="*.png;*.jpg;*.jpeg;*.gif" filterLabel="Image Files" label="Image" name="logoToolbar" fileRequiedForOutput="true" tooltip="Image"/>
</section>
<separator/>
<bool name="toggleTitle" label="Use Title" defaultValue="yesTitle">
<trueVal value="yesTitle">
// Show title
</trueVal>
<falseVal value="noTitle" disableOptions="titleToolbar">
// Hide title
</falseVal>
</bool>
<section label="Title" expanded="true" name="titleToolbar" >
<text name="titleLabel" defaultValue="Toolbar" label="Title" />
<number name="levelHeader" min="1" max="6" step="1" defaultValue="1" label="Level title : "/>
</section>
<separator/>
</parameters>
<headHTML>
//css
</headHTML>
<pageItemHTML>
<!-- insert the Widget <body> HTML here -->
<![CDATA[
<section class="toolbar">
<img class="logo" src="{param_logoToolbar}"/> <-- hide or show
<h{param_levelHeader} class="title">{param_titleLabel}</h{param_levelHeader}> <-- hide or show
</section>
]]>
</pageItemHTML>
</HTMLWidget>
Is there a way to add these two toggle options ?
Yes you can.
As explained in the documentation (http://adobe-muse.github.io/MuCowDocs/#h-bool-) you can just use a trueval-tag and a falseval-tag to do what you want. Note, that between those tags you can add any of the Muse-HTML-components, not only the
<pageItemHTML>.For example
Edit
I think this documentation is better: https://github.com/Adobe-Muse/MuCowDocs
Edit2 Tested and working Code:
EDIT3
After the third attempt I got what you want :D Just use Javascript to do that. You define as many checkboxes as needed and check their value with JS and do the rest... here a simple example: