Conditional visibility of column command

Posted by Community Admin on 04-Aug-2018 15:47

Conditional visibility of column command

All Replies

Posted by Community Admin on 07-Nov-2013 00:00

I need to add a command to the front end pages list. Actually I have already created the command and added it to the Actions list under Administration - Settings - Advanced - ContentView - Controls - FrontEndPages - Views - FrontEndPagesListView - View Modes - TreeTable - Columns - ActionLinkText - MenuItems. I am handling the click event via the client API and redirecting to a custom backend page I've added. It all works perfectly.

Essentially, my custom backend page allows some additional parameters to be added to some metadata about the page and the combined data is written to separate database where it is picked up by a web service for a mobile app. 

My problem is that I only need the command to be visible on group pages, not content pages. Unfortunately, the path I used does exactly the opposite - it only places the command on content pages, not group or redirect pages. 

I have scoured the advanced settings and can't find a similar path for those other page types. In fact, it's clear the redirect and group pages pull from the same set of Actions items, but certain items are being filtered out for non-content pages.

I have also tried adding a data bound command column and tried to set the visibility in a similar fashion to the View option using variations of the syntax below:

<a sys:href=" (Visible) || /Group|Redirect/.test((Status)) ? (PageLiveUrl) : (PageLiveUrl) + '/Action/Preview'" target="_blank" class="sf_binderCommand_mobileSettings">Mobile Settings</a>

The addition of the css class causes the event to fire perfectly, but still no luck setting visibility.

I'm almost certain there's a way to do this, either though the backend UI, or the client API, but I can't find it in the documentation or the forums.

I would greatly appreciate any help with this.

Thanks.

This thread is closed