Git Product home page Git Product logo

Comments (7)

sheadawson avatar sheadawson commented on July 30, 2024

Please check your yml block config against the example given in the readme. If you can't see the issue, paste your config here and I'll have a look at it

from silverstripe-blocks.

brasileric avatar brasileric commented on July 30, 2024

Hi sheadawson,

This is my block config in /mysite/_config/config.yml (as I said works fine till version 1.0.7):

BlockManager:
themes:
main:
areas:
AfterContent: true

Thanks!

from silverstripe-blocks.

sheadawson avatar sheadawson commented on July 30, 2024

I suspect this is an issue with how your themes are set, and how this module checks for which theme is set. I'm not sure at the moment if we should change how the module does this, need to think a bit more about it.

The blocks code in question is here https://github.com/sheadawson/silverstripe-blocks/blob/master/code/BlockManager.php#L143, the getTheme method.

To fix the issue from your end, I think you need to choose how you want to set your theme. Either in yml config via SSViewer:theme or in the SiteConfig (CMS Settings area), but not both. Let me know how you go :)

from silverstripe-blocks.

brasileric avatar brasileric commented on July 30, 2024

Thanks for reply.
I tried something with your suggestion in v 1.0.11, but I think this isn't the issue. I removed the theme set from the yml file. Even when I change this method to:

    private function getTheme()
    {
                return "main";
    }

So when I hard coded my theme, the Blocks tab doesn't appear, back to 1.0.7 it appears. I have this issue in multiple websites, so if this happens to me only I do something wrong structurally :) Well, for now 1.0.7 works fine for me.

from silverstripe-blocks.

sheadawson avatar sheadawson commented on July 30, 2024

Interesting. Yeah I've double checked my test: fresh install of SS 3.4.0, Blocks 1.0.11, your exact yml config and I see the blocks tab.

If you have a moment to check, it probably wouldn't be too hard to debug if you follow the code through from the logic at the top of BlocksSiteTreeExtension->updateCMSFields method

from silverstripe-blocks.

brasileric avatar brasileric commented on July 30, 2024

I found the problem:

In line 68 of BlocksSiteTreeExtension->updateCMSFields there is no default translation for Blocks:

$fields->addFieldToTab('Root', new Tab('Blocks', _t('Block.PLURALNAME')));

So if the used language has a language yaml file the tab will have a name and will appear. But for my language (Dutch) there is no yaml file, so no name to display.

So this line should be:

$fields->addFieldToTab('Root', new Tab('Blocks', _t('Block.PLURALNAME', 'Blocks')));

In version 1.0.7 no translation is used yet :)

from silverstripe-blocks.

sheadawson avatar sheadawson commented on July 30, 2024

I see, thanks for that!

from silverstripe-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.