Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only show preview switch if states are available

We've removed all states from RedirectorPage in order to disable the redirect.
  • Loading branch information...
commit 76e233de705c936e8cee6990ea28469fa661ee30 1 parent 80ee913
@chillu chillu authored
Showing with 22 additions and 20 deletions.
  1. +22 −20 admin/templates/Includes/LeftAndMain_SilverStripeNavigator.ss
View
42 admin/templates/Includes/LeftAndMain_SilverStripeNavigator.ss
@@ -19,25 +19,27 @@
</select>
</span>
- <% if Items.Count < 5 %>
- <fieldset id="preview-states" class="cms-preview-states switch-states size_{$Items.Count}">
- <div class="switch">
- <% loop Items %>
- <input id="$Title" data-name="$Name" class="state-name $FirstLast" data-link="$Link" name="view" type="radio" <% if First %>checked<% end_if %>>
- <label for="$Title"<% if First %> class="active"<% end_if %>><span>$Title</span></label>
- <% end_loop %>
- <span class="slide-button"></span>
- </div>
- </fieldset>
- <% else %>
- <span id="preview-state-dropdown" class="cms-preview-states field dropdown">
- <select title="<% _t('SilverStripeNavigator.PreviewState', 'Preview State') %>" id="preview-states" class="preview-state dropdown nolabel" autocomplete="off" name="preview-state">
- <% loop Items %>
- <option name="$Name" data-name="$Name" data-link="$Link" class="state-name $FirstLast" value="$Link" >
- $Title
- </option>
- <% end_loop %>
- </select>
- </span>
+ <% if Items %>
+ <% if Items.Count < 5 %>
+ <fieldset id="preview-states" class="cms-preview-states switch-states size_{$Items.Count}">
+ <div class="switch">
+ <% loop Items %>
+ <input id="$Title" data-name="$Name" class="state-name $FirstLast" data-link="$Link" name="view" type="radio" <% if First %>checked<% end_if %>>
+ <label for="$Title"<% if First %> class="active"<% end_if %>><span>$Title</span></label>
+ <% end_loop %>
+ <span class="slide-button"></span>
+ </div>
+ </fieldset>
+ <% else %>
+ <span id="preview-state-dropdown" class="cms-preview-states field dropdown">
+ <select title="<% _t('SilverStripeNavigator.PreviewState', 'Preview State') %>" id="preview-states" class="preview-state dropdown nolabel" autocomplete="off" name="preview-state">
+ <% loop Items %>
+ <option name="$Name" data-name="$Name" data-link="$Link" class="state-name $FirstLast" value="$Link" >
+ $Title
+ </option>
+ <% end_loop %>
+ </select>
+ </span>
+ <% end_if %>
<% end_if %>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.