[DOCU-2524] Magnolia Version Mismatch in Documentation for Content View Definition & Columns Created: 03/Aug/22  Updated: 05/Aug/22  Resolved: 04/Aug/22

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Nicole L Assignee: Martin Drápela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation page URL: https://docs.magnolia-cms.com/product-docs/6.2/Apps/App-configuration/Content-view-definition.html
Reporter Name: Nicole
Email: nlovas@ualberta.ca

 Description   

Hello.

The example code provided in the example on the Content View Definition (https://docs.magnolia-cms.com/product-docs/6.2/Apps/App-configuration/Content-view-definition.html) is supposed to be in v6

But when I visit the column definitions example for v6, it's different. (https://docs.magnolia-cms.com/product-docs/6.2/Apps/App-configuration/Column-definition.html)

The contrasting sections:

columns: &columns
      - name: jcrName
        label: name
        $type: jcrTitleColumn
        editable: true
        nodeTypeToIcon:
          mgnl:contact: icon-people
          mgnl:content: icon-folder
        editor:
          availability:
            nodes: true
            properties: true 

and

columns:
  value:
    filterComponent:
      $type: textField
      defaultValue: 10 

I'm not pointing out the fields, but the structure/indentation. (well, the &columns is confusing too...)

One uses 

- name: name

The other uses 

name:

There's a mismatch here that's confusing for programmers. Which one is used for Magnolia V6 and which is for V5? Or does the specific syntax not matter?



 Comments   
Comment by Roman Kovařík [ 04/Aug/22 ]

Hi nlovas,

both Magnolia 5 & 6 are able to use arrays or also convert maps to arrays.

https://docs.magnolia-cms.com/product-docs/6.2/Developing/YAML.html#_defining_a_list_property_via_yaml_map_or_list_syntax

 

&column is an anchor which allow us to reference the same config from the other view type (e.g. it's defined in the tree view and reused in the list view.)

https://docs.magnolia-cms.com/product-docs/6.2/Developing/YAML.html#_reusing_an_existing_definition_within_the_same_file

 

Hope that helps 

Roman

Comment by Nicole L [ 04/Aug/22 ]

Thank you Roman, that helps

Generated at Mon Feb 12 01:27:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.