Try Now
More in this section

Forums / Developing with Sitefinity / Conditional visibility of column command

Conditional visibility of column command

1 posts, 0 answered
  1. Mike
    Mike avatar
    1 posts
    22 Aug 2013
    07 Nov 2013
    Link to this post
    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.

1 posts, 0 answered