cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a content view result layout

pegsablaze_
Champ on-the-rise
Champ on-the-rise

I understand that filters are used on actions. However, I want to control who sees a result layout option on a content view. Is this possible? How can I achieve this?

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Buttons here are custom buttons part of the content view template and are not controlled by filters although that would be a nice improvement.

If you'd like to put this in place, you'll have to override the default template and maybe hardcode behaviour depending on the content views that you'd like to affect. Note that you can still use filters to control this (checking #{webActions.checkFilter('filterId')} in the template, for instance).

The template in 5.8 is at https://github.com/nuxeo/nuxeo-jsf/blob/master/nuxeo-platform-webapp-base/src/main/resources/web/nux...

View answer in original post

4 REPLIES 4

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Buttons here are custom buttons part of the content view template and are not controlled by filters although that would be a nice improvement.

If you'd like to put this in place, you'll have to override the default template and maybe hardcode behaviour depending on the content views that you'd like to affect. Note that you can still use filters to control this (checking #{webActions.checkFilter('filterId')} in the template, for instance).

The template in 5.8 is at https://github.com/nuxeo/nuxeo-jsf/blob/master/nuxeo-platform-webapp-base/src/main/resources/web/nux...

I was thinking of something along those lines, but I didn't want to have to hard code the behavior.

Ooh! Followup, is there a way to find out the name of the view? IE, checkName('viewname') to determine if the view name matches? At least then I could use the checkFilter() in conjunction, and not REALLY hardcode it in there.

If you mean the name of the content view, yes, you have access to #{contentView.name}. You can add to it the result layout name #{cvLayout.name} and define a filter id to check like this, maybe using a marker (or another convention) to avoid collisions with other filter ids.