Issue #742💬 AnsweredOpened January 10, 2018by JuanTincho0 reactions

Choose order and visibility of Categories

快速解答by artf

I think that change in BlocksView is not necessary (at first look). If you pass the category as an object it will be added as it is with all its properties. If for a change you mean updating the view of the category with an order style (if exists) I'm ok with it

Read full answer below ↓

Question

Hey @artf , we need to be able to change the categories order and visibility when the application starts.

I was able to do it changing the model in the Category and this piece of code in BlocksView.js:

if (category && this.categories) {
      if (typeof category.label == 'string') {
        category = {
          id: category.label,
          label: category.label,
          order: category.order,
          open: category.open,
        };
      }

...and setting the order in a flexbox property.

I wanted to know if you think this is a good approach or you have another suggestion.

I'm willing to do a PR.

Thank you!

Answers (2)

artfJanuary 11, 2018

I think that change in BlocksView is not necessary (at first look). If you pass the category as an object it will be added as it is with all its properties. If for a change you mean updating the view of the category with an order style (if exists) I'm ok with it

lock[bot]September 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.