Skip to content

Instantly share code, notes, and snippets.

@sotirisf
Last active December 19, 2020 16:26
Show Gist options
  • Save sotirisf/b6d4e83f5216144787f41221145f4aba to your computer and use it in GitHub Desktop.
Save sotirisf/b6d4e83f5216144787f41221145f4aba to your computer and use it in GitHub Desktop.
Hide unpublished variants 3
using System.Configuration;
using System.Web.Http;
namespace Site.Core.ApiControllers
{
public class TreeVariantSettingsController : Umbraco.Web.WebApi.UmbracoApiController
{
[HttpGet]
public string HideUnpublishedVariantsFromTree()
{
var retVal = ConfigurationManager.AppSettings.Get("HideUnpublishedVariantsFromTree") ?? "false";
return (retVal.ToLower()); ;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment