0
Welcome Guest! Login
0 items Join Now

SOLVED Add grid columns to Block Content particle

  • SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • I try to modify Block Content particle to place items in 2-3 columns.
      As a sample I have used Grid Content and Grid Statistic particles, created new in /custom/particle/blockcontent.yaml and ...html.twig with following changes in blockcontent.yaml
      cols:
            type: select.select
            label: Grid Column
            description: Select the grid column amount
            placeholder: 'Select...'
            default: g-blockcontent-2cols
            options:
              g-blockcontent-1cols: 1 Column
              g-blockcontent-2cols: 2 Columns
              g-blockcontent-3cols: 3 Columns
              g-blockcontent-4cols: 4 Columns
      this field succesfully appear, but of course not works, without proper funcionality.
      I try to use part of gridcontent.html.twig code with modification in the new blockcontent.html.twig
      <div class="g-blockcontent-wrapper {{ particle.cols|e }}">
      {% for blockcontentitem in particle.blockcontentitems %}
      </div> 
      and created necessary classes in custom.scss based on _gridcontent.scss code
      .g-blockcontent {
          .g-blockcontent-wrapper {
              margin:1px; 
          }
          .g-blockcontent-item {
              margin: 0px;
              width: 100%;
              display: inline-block;
              padding:0px;
              .g-blockcontent-item-wrapper {
                  i.fa, span {
                      display: block;
                      text-align: center;
                }          
         	   }
      	 }
        }
          .g-blockcontent-wrapper {
              margin:1px ;
      }
          .g-blockcontent-2cols {
              .g-blockcontent-item {
                  width: 50%;
              }
          }
          .g-blockcontent-3cols {
              .g-blockcontent-item {
                  width: 33.33333%;
              }
          }
          .g-blockcontent-4cols {
              .g-gridcontent-item {
                  width: 25%;
              }
          }
      but anyway I have message: Error while rendering blockcontent particle.
      I suppose that this line is the key of problem and I don't understand it at all.
      {% for blockcontentitem in particle.blockcontentitems %}
      Please advise
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • Please try
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • why you ask FTP access if you not use it?
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • This message contains only secure information that is visible to Damir, moderators and administrators
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • Super! Thanks a lot!
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • Borys Grebnevskyi wrote:
      Super! Thanks a lot!
  • Re: SOLVED Add grid columns to Block Content particle

    Posted 5 years 1 month ago
    • Dear Damir, can you please publish solution.
      By mistake I have deleted first line of custom.scss and can't renew it

Time to create page: 0.045 seconds