Subsites: hide "Main Site" from subsite chooser in backend

So your client wants to manage multiple websites with one CMS installation and you've choosen Subsites module for that purpose, there is always that magical "Main Site" in your site chooser.

This "Main Site" is the subsite with the ID 0 (some kind of non-Subsite), and there doesn't seem to be a way to disable this using configuration. But we can modify the template showing the subsite select field in backend, which is located in subsites/templates/Includes/

<div class="cms-subsites" data-pjax-fragment="SubsiteList">
	<div class="field dropdown">
		<select id="SubsitesSelect">
			<% loop $ListSubsites %>
				<% if $ID %>
                    <option value="$ID" $CurrentState>$Title</option>
				<% end_if %>
			<% end_loop %>

Simply copy this to mysite/templates/Includes/ and subsite chooser in the left navigation should not show "Main Site" any more.

Rate this post (1 rating(s))

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments