10

I am using Sitecore Experience Accelerator 1.4 and I do not want to use Bootstrap, Foundation or Grid960. I have my custom CSS framework. Anyone can provide me a solution that how I can add a new Grid?

1
  • According to this page you can create your own grid: doc.sitecore.net/sitecore_experience_accelerator/… 'SXA supports integrating other grid frameworks and you can also build your own.' I'm not exactly sure how you go about doing this though as can't find any docs on it. However it looks like you might need to add to the base themes here: /sitecore/Media Library/Base Themes. Jul 5, 2017 at 10:05

1 Answer 1

12

It is easy. The implementation steps are low complexity. See how bootstrap is configured

Create Grid Theme

Example:

/sitecore/media library/Feature/Experience Accelerator/Bootstrap/Bootstrap

Why/What?

It is your custom grid theme. The most important thing is to include your css file with all your grid classes

Create Grid Definition

Example:

/sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap/Grid Definition

Why/What?

This item contains children which defines your devices (Phone, Desktop). Each device can have different properties (Size, Push, Pull, Offset) and each property can have different values (css classes, for example col-xs-1 for Phone Device->Size->1, you will use your grid classes here)

Fields:

  • RenderingParametersFieldType - I assume you are not doing anything custom here, so you can use default field renderer: Sitecore.XA.Foundation.Grid.Fields.FieldRenderers.GridRenderingParametersFieldRenderer, Sitecore.XA.Foundation.Grid. Once you fill this field and save an item you should see DefaultGridParameters rendering your configuration.
  • DefaultGridParameters - provide default values here
  • Grid Theme - link to your grid theme defined in step 1
  • GridFieldParserType - link in first point, use default: Sitecore.XA.Foundation.Grid.Parser.GridFieldParser,Sitecore.XA.Foundation.Grid if you are not going to customize anything.
    • GridBodyViewPath - path to your cshtml file which contains your grid layout. Remember to include all necessary placeholders (header, main, footer)

Create Scaffolding Setup

Example:

/sitecore/system/Settings/Feature/Experience Accelerator/Bootstrap/Grid Setup

Why/What?

This item contains only link to a Grid Definition and Name that will appear in a new Site Dialog in the tab with grid selection

2
  • 4
    I think the thing I hate the most about SXA is how everyone writing about it keep saying "It is easy". It's easy when you are use to it, just like it's easy for me to perform Sub-Zero MkII Fatality, but for someone who start with SXA, it's everything but easy. Mar 28, 2018 at 19:36
  • I would agree with @SimonArnold Jul 4, 2018 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.