gforcada
(gforcada)
January 2, 2017, 11:11am
#1
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 :
Something like this should work(untested):
go to site setup -> resource registries
click pattern options tab
add "structure" with the value something like this: {"momentFormat": "-your format-"}
But using the same approach with activeColumns
seems to not work:
'portal_type',
'review_state',
'Subject',
'Title',
'total_comments',
'UID'
],
activeColumns: null,
_default_activeColumns: [
'ModificationDate',
'EffectiveDate',
'review_state'
],
availableColumns: null,
_default_availableColumns: {
'id': 'ID',
'ModificationDate': 'Last modified',
'EffectiveDate': 'Published',
'ExpirationDate': 'Expiration',
I posted a question on stackoverflow for it already but so far no answer there either:
plone, plone-5.x
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?
sandros87
(Sandros87)
March 1, 2019, 1:30pm
#2
Hi,
did you found an easy solution for this? Just like you I need to set default active columns.
rodfersou
(Rodrigo Ferreira de Souza)
June 4, 2019, 5:25am
#3
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"]
spereverde
(Kim Paulissen)
October 28, 2019, 3:52pm
#4
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
).
2 Likes