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

feat: Built-in options to hide blocks for certain languages #37

Merged
merged 8 commits into from
Nov 6, 2024

Conversation

dulnan
Copy link
Collaborator

@dulnan dulnan commented Nov 6, 2024

Built-in global option: bkVisibleLanguages

Can be enabled as a global option on blocks. Once enabled, the option will display all available languages as checkboxes. If one or more languages are selected, the block will only be rendered for the selected languages. During editing the block is always rendered, however it will be displayed translucent to indicate it won't be visible

Built-in global option: bkHiddenGlobally

When enabled and checked the block will always be hidden during non-editor rendering.

Translatable option labels

Labels for global or per-block options can now also be translated using the special blockOption_PROPERTY_label key. For example:

const { options } = defineBlokkli({
  bundle: 'card',

  options: {
    showMobile: {
      type: 'checkbox',
      label: 'Show on Mobile',
      default: true,
    },
  },
})

This label can now be translated via module configuration:

export default defineNuxtConfig({
  blokkli: {
    translations: {
      de: {
        blockOption_showMobile_label: 'Auf Mobile anzeigen',
      },
    },
  },
})

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for blokkli-docs ready!

Name Link
🔨 Latest commit 23e15bc
🔍 Latest deploy log https://app.netlify.com/sites/blokkli-docs/deploys/672b35f1617aaf0008460d4b
😎 Deploy Preview https://deploy-preview-37--blokkli-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for blokkli ready!

Name Link
🔨 Latest commit 71559d2
🔍 Latest deploy log https://app.netlify.com/sites/blokkli/deploys/672b4edb371bf900085a8559
😎 Deploy Preview https://deploy-preview-37--blokkli.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for blokkli-docs ready!

Name Link
🔨 Latest commit 71559d2
🔍 Latest deploy log https://app.netlify.com/sites/blokkli-docs/deploys/672b4edbf2f9ab0008ee4930
😎 Deploy Preview https://deploy-preview-37--blokkli-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dulnan dulnan merged commit 4cae79b into main Nov 6, 2024
4 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.

1 participant