Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visibleCondition for block-setting icons #7360

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

Prokyonn
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Adds a visibleCondition to the sulu.block_setting_icon tag.

Why?

Previously the icon was only shown, when the checkbox was set to true, this condition makes it more flexible, you can now also render the icon when the checkbox is false but other conditions are true.

Example Usage

Show the icon only when the page locale is de or en and the checkbox is true.

<property name="showInAustria" type="checkbox" visibleCondition="__locale in ['de', 'en']">
        <params>
            <param name="description">
                <meta>
                    <title lang="en">This block will be visible for the Austrian .at domain</title>
                    <title lang="de">Dieser Block wird für die österreichische .at Domain sichtbar sein
                    </title>
                </meta>
            </param>
            <param name="icon" value="su-app-austria"/>
            <param name="label">
                <meta>
                    <title lang="en">Austria (.at)</title>
                    <title lang="de">Österreich (.at)</title>
                </meta>
            </param>
            <param name="skin" value="heading"/>
            <param name="type" value="toggler"/>
            <param name="default_value" value="true"/>
        </params>
        
        <tag name="sulu.block_setting_icon" icon="su-app-austria" visibleCondition="__locale in ['de', 'en'] and settings.showInAustria == true"/>
 </property>

To Do

  • Create a documentation PR

@wachterjohannes wachterjohannes merged commit fb2587b into sulu:2.6 Apr 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants