Giter Site home page Giter Site logo

Comments (5)

valdisiljuconoks avatar valdisiljuconoks commented on July 25, 2024

Hi,

Just to rephrase to get an idea, you are looking for a way to add explicit "None" display option, this option does not add any CSS classes to the content area item wrapper element and make it default everywhere (in all content areas for newly added blocks)?

from optimizely-advanced-contentarea.

JasonRodman avatar JasonRodman commented on July 25, 2024

Yes, that was the idea I had at the time. I just needed a way for the default to not add the css classes unless a specific layout option was chosen. I found a workaround for the moment. In an initialization module I turned off all the built in display options and then added them all back in, but changed the tag used for the full width option. This tricked your renderer into not putting the default full width css classes since the hard-coded default tag doesn't exist in the display options. So the "automatic" choice now behaves like this and worked beautifully without having to add an explicit "none" option. Its not ideal but it works for now.

from optimizely-advanced-contentarea.

valdisiljuconoks avatar valdisiljuconoks commented on July 25, 2024

great that you found workaround within existing functionality. default global display option is nice feature request anyways.

would you mind sharing your init module code?

from optimizely-advanced-contentarea.

JasonRodman avatar JasonRodman commented on July 25, 2024

Yeah, that would be great coupled with a discreet "None" option that disables the css classes as well. I could not get a none option to work in my experimentation. I tried to set all the css patterns to empty strings but it ignored them. The closest I got was to setting all the width settings to zero, which didnt match up with any css styles and were ignored. Here is my init module code:

` ConfigurationContext.Setup(ctx =>
{
ctx.DisableBuiltinDisplayOptions = true;

            // override display options so that the default is not full width
            // so we can avoid adding the bootstrap classes unless the user
            // specifically requests them to be added by choosing a size.
            ctx.CustomDisplayOptions.AddRange(new[]
            {
                new DisplayModeFallback
                {
                    Name = "Full width (1/1)",
                    Tag = ContentAreaTags.FullWidth + "-width", 
                    LargeScreenWidth = 12,
                    MediumScreenWidth = 12,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--full"
                },
                new DisplayModeFallback
                {
                    Name = "Three quarters width (3/4)",
                    Tag = ContentAreaTags.ThreeQuartersWidth,
                    LargeScreenWidth = 9,
                    MediumScreenWidth = 6,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--three-quarters"
                },
                new DisplayModeFallback
                {
                    Name = "Two thirds width (2/3)",
                    Tag = ContentAreaTags.TwoThirdsWidth,
                    LargeScreenWidth = 8,
                    MediumScreenWidth = 6,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--two-thirds"
                },
                new DisplayModeFallback
                {
                    Name = "Half width (1/2)",
                    Tag = ContentAreaTags.HalfWidth,
                    LargeScreenWidth = 6,
                    MediumScreenWidth = 6,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--half"
                },
                new DisplayModeFallback
                {
                    Name = "One third width (1/3)",
                    Tag = ContentAreaTags.OneThirdWidth,
                    LargeScreenWidth = 4,
                    MediumScreenWidth = 6,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--one-third"
                },
                new DisplayModeFallback
                {
                    Name = "One quarter width (1/4)",
                    Tag = ContentAreaTags.OneQuarterWidth,
                    LargeScreenWidth = 3,
                    MediumScreenWidth = 6,
                    SmallScreenWidth = 12,
                    ExtraSmallScreenWidth = 12,
                    Icon = "epi-icon__layout--one-quarter"
                }
            });
        });`

from optimizely-advanced-contentarea.

valdisiljuconoks avatar valdisiljuconoks commented on July 25, 2024

v5.3 is on the way to the feed

from optimizely-advanced-contentarea.

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.