We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Enhanced Grid field

Feature Requests

Rob Allen's avatar
Rob Allen
2,950 posts
6 years ago
Rob Allen's avatar Rob Allen

With the current grid you can only add rows of data. What if you need authors to be able to specify additional variables for the grid data, for instance to control the presentation?

Example:

I want to allow authors to specify how the list is styled from a predefined list, such as “normal” or “highlighted” (i.e. so I can use a field to add a custom CSS class value)

At the moment there’s no easy/logical way to do that.

The idea:

  1. Introduce the ability to add “one time” data fields to a grid field that aren’t included in the grid row loop
  2. Fields could appear at the top or bottom of a grid field on the publish page
  3. Field variables would obviously be available in front end templates
{grid}

  {if grid_count == 1}
  <ul class="{grid_one_time_field}">
  {/if}

  <li>{grid:item}</li>

  {if grid:count == grid:total_results}
  </ul>
  {/if}

{/grid}
       
Kurt Deutscher's avatar
Kurt Deutscher
827 posts
6 years ago
Kurt Deutscher's avatar Kurt Deutscher

I ran into this a while back too. It would be handy to have the ability to assign non-looping variables (class & ID maybe) to grid layouts that could be “set” within the grid field part of the CP so that publishers know it’s associated with that grid.

{grid}
        {grid:id} {grid:class}
{/grid}

I’m envisioning a kind of HTML button row at the top of the grid field in the CP, … or a menu maybe.. not a text area.

How would you see this working in the CP Rob?

       
Rob Allen's avatar
Rob Allen
2,950 posts
6 years ago
Rob Allen's avatar Rob Allen

Hey Kurt!

When you create a grid they would be two types of fields, repeating and non-repeating:

  1. Repeating field is as it is now, add your column fields, job done.

  2. Non-repeating fields you could add as many of as needed, but they’d be single field, single use, nearly any field type, there might have to be a few limitations as to what field types are available but certainly generic fields like TEXT, RTE, SELECT, RADIO, CHECKBOX should be do-able..

On the publish page I’d see it as the non-repeating fields coming first above the actual repeating grid so you could set values for the whole grid.

Possible examples:

  • Set a class/style name
  • Add a custom “heading” or table caption if grid data is tabulated
  • Options, e.g. Restrict output to logged in only - Yes/No
  • A description - sometimes you need one that’s specific to the grid data
  • Footnotes
  • Link/Call to action

… possible dozens more!

       
benoitlemay's avatar
benoitlemay
19 posts
6 years ago
benoitlemay's avatar benoitlemay

I like the idea of “Repeating field and non-repeating fields”!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.