Change folder_contents to show other columns

I'm trying to modify folder_contents to showing something else rather than the default 3 columns (last modified, publication date and review state).

I saw this here on community.plone.org:

But using the same approach with activeColumns seems to not work:

I posted a question on stackoverflow for it already but so far no answer there either:

Any advice? Since I posted the stackoverflow question I noticed the activeColumns on the mockup structure pattern, so, maybe I have to compile my own version of mockup?

Hi,
did you found an easy solution for this? Just like you I need to set default active columns.

Looks like the right way to do it is loading the module and changing it's prototype:

var structure = require('mockup-patterns-structure');
structure.prototype.defaults._default_activeColumns = ["ModificationDate","EffectiveDate","review_state","id","Type"]

and you can also do this via the resource registry like Nathan suggested in the date format question that gforcada referenced to:

  • Go to the resource registry - Pattern Options tab, add a pattern called 'structure' with this value:

    {"_default_activeColumns": ["ModificationDate","EffectiveDate","id","review_state","Type"]}

Since resource registry settings are saved in the (registry.xml), you can export the Export the configuration registry schemata step via ZMI - portal_setup - export, this will show you the full registry.xml. Something like this will be inside for the pattern options:

<record name="plone.patternoptions">
<field type="plone.registry.field.Dict">
  <description>Base pattern configuration options</description>
  <key_type type="plone.registry.field.ASCIILine"/>
  <title>Patterns configuration</title>
  <value_type type="plone.registry.field.Text"/>
</field>
<value>
  <element key="plone-modal">{"actionOptions": {"displayInModal": false}}</element>
  <element key="pickadate">{"date": {"selectYears": 200}, "time": {"interval": 5 } }</element>
  <element key="structure">{"momentFormat": "MMM DD, YYYY","_default_activeColumns": ["ModificationDate","EffectiveDate","id","review_state","Type"]}</element>
</value>
</record>

Then you can move this record into your package code (profiles/default/registry.xml).

1 Like

Plone Foundation Code of Conduct