├── .editorconfig ├── .github └── workflows │ └── dotnet.yml ├── .gitignore ├── README.md ├── Umbraco.Docs.Samples.Web ├── App_Plugins │ ├── FavouriteThings │ │ └── Lang │ │ │ └── en-us.xml │ └── MyCustomDashboard │ │ ├── dashboard.html │ │ └── lang │ │ └── en-US.xml ├── Backoffice Search │ ├── BackofficeSearchComposer.cs │ └── CustomUmbracoTreeSearcherFields.cs ├── Components │ └── ProductView │ │ └── ProductViewViewComponent.cs ├── Controllers │ ├── Api │ │ └── PeopleController.cs │ ├── DefaultController.cs │ ├── PersonController.cs │ └── UmbAlternativeRegisterController.cs ├── CustomIndexing │ ├── ConfigureProductIndexOptions.cs │ ├── ExamineComposer.cs │ ├── ProductIndex.cs │ ├── ProductIndexPopulator.cs │ └── ProductIndexValueSetBuilder.cs ├── Dashboards │ ├── MyCustomDashboard.cs │ ├── MyDashboardComposer.cs │ └── RemoveDashboard.cs ├── Notifications │ ├── AllUnPublishedCheck.cs │ ├── AllUnPublishingCheck.cs │ ├── CulturePublishedCheck.cs │ ├── CulturePublishingCheck.cs │ ├── CultureSavedCheck.cs │ ├── CultureSavingCheck.cs │ ├── CultureUnpublishedCheck.cs │ ├── CultureUnpublishingCheck.cs │ ├── DontShout.cs │ ├── EditorSendingContentNotificationHandler.cs │ ├── EditorSendingMemberNotificationHandler.cs │ ├── RoomCleanedNotification.cs │ ├── RoomCleanedNotificationHandler.cs │ ├── SendingAllowedChildrenNotificationHandler.cs │ ├── TreeNotificationHandler.cs │ └── UmbracoBuilderNotificationExtensions.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Property-Editors-Add-Values │ └── CreateImageCropperValuesController.cs ├── RecurringHostedService │ ├── CleanUpYourRoom.cs │ └── UmbracoBuilderHostedServiceExtensions.cs ├── Services │ ├── MediaServiceSamplesController.cs │ └── SearchService.cs ├── Startup.cs ├── Stylesheets-Javascript │ ├── CreateBundlesNotificationHandler.cs │ └── UmbracoBuilderNotificationExtensions.cs ├── Trees │ ├── FavouriteThingsSearchableTree.cs │ ├── FavouriteThingsTreeController.cs │ └── UmbracoBuilderSearchableTreeExtensions.cs ├── Tutorials │ ├── ConfigureStaticFileOptions.cs │ └── UmbracoBuilderNotificationExtensions.cs ├── Umbraco.Docs.Samples.Web.csproj ├── Views │ ├── Blog.cshtml │ ├── Blogpost.cshtml │ ├── Contact.cshtml │ ├── ContentPage.cshtml │ ├── Home.cshtml │ ├── MacroPartials │ │ ├── FeaturedProducts.cshtml │ │ ├── LatestBlogposts.cshtml │ │ ├── Login.cshtml │ │ └── Register.cshtml │ ├── Master.cshtml │ ├── Partials │ │ ├── CategoryLinks.cshtml │ │ ├── ContactForm.cshtml │ │ ├── Fundamentals │ │ │ ├── Backoffice │ │ │ │ └── Built-in-Property-Editors │ │ │ │ │ └── Image-Cropper.cshtml │ │ │ └── Design │ │ │ │ └── Rendering-Media.cshtml │ │ ├── LoginStatus.cshtml │ │ ├── Navigation │ │ │ ├── SubNavigation.cshtml │ │ │ └── TopNavigation.cshtml │ │ ├── SectionHeader.cshtml │ │ ├── blockgrid │ │ │ ├── area.cshtml │ │ │ ├── areas.cshtml │ │ │ ├── default.cshtml │ │ │ └── items.cshtml │ │ ├── blocklist │ │ │ └── default.cshtml │ │ └── grid │ │ │ ├── bootstrap3-fluid.cshtml │ │ │ ├── bootstrap3.cshtml │ │ │ └── editors │ │ │ ├── base.cshtml │ │ │ ├── embed.cshtml │ │ │ ├── macro.cshtml │ │ │ ├── media.cshtml │ │ │ ├── rte.cshtml │ │ │ └── textstring.cshtml │ ├── People.cshtml │ ├── Person.cshtml │ ├── Product.cshtml │ ├── Products.cshtml │ ├── Shared │ │ └── Components │ │ │ └── ProductView │ │ │ └── Default.cshtml │ └── _ViewImports.cshtml ├── appsettings.Development.json ├── appsettings.json ├── umbraco │ ├── Data │ │ └── Umbraco.sqlite.db │ └── models │ │ ├── Blog.generated.cs │ │ ├── Blogpost.generated.cs │ │ ├── Contact.generated.cs │ │ ├── ContentBase.generated.cs │ │ ├── ContentPage.generated.cs │ │ ├── CustomImage.generated.cs │ │ ├── Feature.generated.cs │ │ ├── File.generated.cs │ │ ├── Folder.generated.cs │ │ ├── Home.generated.cs │ │ ├── Image.generated.cs │ │ ├── Member.generated.cs │ │ ├── NavigationBase.generated.cs │ │ ├── People.generated.cs │ │ ├── Person.generated.cs │ │ ├── Product.generated.cs │ │ ├── Products.generated.cs │ │ ├── UmbracoMediaArticle.generated.cs │ │ ├── UmbracoMediaAudio.generated.cs │ │ ├── UmbracoMediaVectorGraphics.generated.cs │ │ └── UmbracoMediaVideo.generated.cs └── wwwroot │ ├── css │ ├── test-style.css │ └── umbraco-starterkit-style.css │ ├── images │ └── unicorn.jpg │ ├── media │ ├── 0aslars0 │ │ └── 7377957524_347859faac_b.jpg │ ├── 17552d12081d4d01b68132c495d6576f │ │ └── 7373036290_5e8420bf36_b.jpg │ ├── 1bc5280b8658402789d958e2576e469b │ │ └── 14272036539_469ca21d5c_h.jpg │ ├── 1c3833ce637f4985a142e029d1d50cac │ │ └── 18720470241_ff77768544_h.jpg │ ├── 1d0b713a022a49c8b842a2463c83a553 │ │ └── 7373036208_30257976a0_b.jpg │ ├── 1k2bvtyp │ │ └── jan-skovgaard.jpg │ ├── 20e3a8ffad1b4fe9b48cb8461c46d2d0 │ │ └── 7371127652_e01b6ab56f_b.jpg │ ├── 34371d0892c84015912ebaacd002c5d0 │ │ └── 18530280048_459b8b61b2_h.jpg │ ├── 3a8c3d0bd46b4c25907a6479354ac65d │ │ └── 16403439029_f500be349b_o.jpg │ ├── 46a025d6095a4b148b961b59ca4e951c │ │ └── 7377957524_347859faac_b.jpg │ ├── 4c4e24ba8b1d44b6903412be100001fb │ │ └── 18095416144_44a566a5f4_h.jpg │ ├── 55514845b8bd487cb3709724852fd6bb │ │ └── 4730684907_8a7f8759cb_b.jpg │ ├── 5guogia1 │ │ └── 7371127652_e01b6ab56f_b.jpg │ ├── 5u3kkwsd │ │ └── damiaan.jpg │ ├── 662af6ca411a4c93a6c722c4845698e7 │ │ └── 16403439029_f500be349b_o.jpg │ ├── 732e8047f76342e09974ea886dfe05c0 │ │ └── 18095416144_44a566a5f4_h.jpg │ ├── 79a350528c974a118948172f027f1273 │ │ └── 18720470241_ff77768544_h.jpg │ ├── abchlerf │ │ └── poornima_nayar.jpg │ ├── amoot1xi │ │ └── matt-brailsford.jpg │ ├── b73f6c8a3e8e437fb4f7d5642a76ac43 │ │ └── 18530280048_459b8b61b2_h.jpg │ ├── b76ddb4ee603401499066087984740ec │ │ └── 5852022091_87c5d045ab_b.jpg │ ├── bm5hn4xl │ │ └── lee-kelleher.jpg │ ├── buumkg0y │ │ └── 14272036539_469ca21d5c_h.jpg │ ├── c0969cab13ab4de9819a848619ac2b5d │ │ └── 18095416144_44a566a5f4_h.jpg │ ├── c09ec77f08e3466aac58c979befd3cd6 │ │ └── 5852022211_9028df67c0_b.jpg │ ├── c4784c9fc99a4a5ab7e2224cf16dd354 │ │ └── 18095416144_44a566a5f4_h.jpg │ ├── cf1ab8dcad0f4a8e974b87b84777b0d6 │ │ └── 18720470241_ff77768544_h.jpg │ ├── cqwfkfy3 │ │ └── 7373036290_5e8420bf36_b.jpg │ ├── doxkuvnu │ │ └── ravi-motha.jpg │ ├── dsypff0x │ │ └── laura_weatherhead.jpg │ ├── eee91c05b2e84031a056dcd7f28eff89 │ │ └── 18531852339_981b067419_h.jpg │ ├── ef1lf1dc │ │ └── marc.jpg │ ├── fa763e0d0ceb408c8720365d57e06e32 │ │ └── 18531854019_351c579559_h.jpg │ ├── fzobwfow │ │ └── janae_cram.jpg │ ├── gyyhgk2m │ │ └── busra_sengul-1.jpg │ ├── hrybwhjk │ │ └── 7373036208_30257976a0_b.jpg │ ├── inefcvn3 │ │ └── 4730684907_8a7f8759cb_b.jpg │ ├── ipojkdd2 │ │ └── carole.jpg │ ├── jdnh1nyd │ │ └── 5852022091_87c5d045ab_b.jpg │ ├── jhmnxmkc │ │ └── heather.jpg │ ├── kw2btapv │ │ └── sophie.jpg │ ├── m5xlws44 │ │ └── busra_sengul.jpg │ ├── nbrdm1dz │ │ └── emma.jpg │ ├── nhjhj1wp │ │ └── erica_quessenberry.jpg │ ├── phdj3qhd │ │ └── 5852022211_9028df67c0_b.jpg │ ├── sicdivlf │ │ └── sofie.jpg │ ├── uetpbykg │ │ └── poorinma.jpg │ ├── uoqevap5 │ │ └── busra_sengul-1.jpg │ ├── uwvlvnzi │ │ └── lotte.jpg │ ├── vvlnw31z │ │ └── emmanuel_tissera.jpg │ ├── vwojnqfl │ │ └── jeavon-leopold.jpg │ ├── wupnyv5c │ │ └── laura.jpg │ └── zt1cuzq0 │ │ └── 16403439029_f500be349b_o.jpg │ └── scripts │ ├── test-script1.js │ ├── test-script2.js │ └── umbraco-starterkit-app.js ├── Umbraco.Docs.Samples.sln └── global.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_style = space 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | 9 | [*.{cs,cshtml,csx,vb,vbx,vbhtml,fs,fsx,txt,ps1,sql}] 10 | indent_size = 4 -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: [ "develop" ] 6 | pull_request: 7 | branches: [ "develop" ] 8 | 9 | jobs: 10 | build: 11 | name: build-and-test-${{matrix.os}} 12 | runs-on: ${{matrix.os}} 13 | strategy: 14 | matrix: 15 | os: [ubuntu-latest, windows-latest, macOS-latest] 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Setup .NET 20 | uses: actions/setup-dotnet@v3 21 | with: 22 | dotnet-version: 7.0.x 23 | - name: Restore dependencies 24 | run: dotnet restore 25 | - name: Build 26 | run: dotnet build --no-restore 27 | - name: Test 28 | run: dotnet test --no-build --verbosity normal 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Umbraco.Docs.Samples - v12 2 | 3 | **Umbraco v10 branch** can be found at [here](https://github.com/umbraco/Umbraco.Docs.Samples/tree/develop-v10) 4 | **Umbraco v11 branch** can be found at [here](https://github.com/umbraco/Umbraco.Docs.Samples/tree/develop-v11) 5 | 6 | This GitHub project contains a Umbraco site which is currently using SQLLite and has the [v11 Starter Kit](https://github.com/umbraco/The-Starter-Kit/tree/v11/dev) installed. 7 | 8 | Default Umbraco user is: 9 | 10 | * Email: docs@umbraco.com 11 | * Password: 1234567890 12 | 13 | ## Contributing 14 | 15 | It would be really rather wonderful if people contributed examples of different techniques synchronised with the examples in the Umbraco Documentation. 16 | 17 | For the time-being, create a folder for the 'type of example' at the root of the solution, we will advise if it should be a subfolder of something else, but main thing is to get buildable, workable, usable examples in place! 18 | 19 | Only commit the Umbraco.sqlite.db file back in your contribution, if you have needed to change the Umbraco implementation to illustrate your example, we're trying to keep it as close to the shipped starter kit, so if something in there can be re-purposed to illustrate the example, then use that first. If not it's ok to add new DocTypes, Properties if it will help make the examples more real world and clearer! 20 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/App_Plugins/FavouriteThings/Lang/en-us.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Favourites 5 | 6 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/App_Plugins/MyCustomDashboard/dashboard.html: -------------------------------------------------------------------------------- 1 |
2 | MyCustomDashboard 3 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/App_Plugins/MyCustomDashboard/lang/en-US.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My Dashboard 5 | 6 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Backoffice Search/BackofficeSearchComposer.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Composing; 2 | using Umbraco.Cms.Core.DependencyInjection; 3 | using Umbraco.Cms.Infrastructure.Examine; 4 | using Umbraco.Extensions; 5 | 6 | //https://our.umbraco.com/documentation/Extending/Backoffice-Search/ 7 | 8 | namespace Umbraco.Docs.Samples.Web.BackofficeSearch 9 | { 10 | public class BackofficeSearchComposer : IComposer 11 | { 12 | public void Compose(IUmbracoBuilder builder) 13 | { 14 | builder.Services.AddUnique(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Backoffice Search/CustomUmbracoTreeSearcherFields.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Umbraco.Cms.Core.Services; 3 | using Umbraco.Cms.Infrastructure.Examine; 4 | using Umbraco.Cms.Infrastructure.Search; 5 | 6 | //https://our.umbraco.com/documentation/Extending/Backoffice-Search/ 7 | 8 | namespace Umbraco.Docs.Samples.Web.BackofficeSearch 9 | { 10 | public class CustomUmbracoTreeSearcherFields : UmbracoTreeSearcherFields, IUmbracoTreeSearcherFields 11 | { 12 | public CustomUmbracoTreeSearcherFields(ILocalizationService localizationService) : base(localizationService) 13 | { 14 | } 15 | 16 | //Adding custom field to search in all nodes 17 | public new IEnumerable GetBackOfficeFields() 18 | { 19 | return new List(base.GetBackOfficeFields()) { "parentID" }; 20 | } 21 | 22 | //Adding custom field to search in document types 23 | public new IEnumerable GetBackOfficeDocumentFields() 24 | { 25 | return new List(base.GetBackOfficeDocumentFields()) { "parentID" }; 26 | } 27 | 28 | //Adding custom field to search in media 29 | public new IEnumerable GetBackOfficeMediaFields() 30 | { 31 | return new List(base.GetBackOfficeMediaFields()) { "parentID" }; 32 | } 33 | 34 | //Adding custom field to search in members 35 | public new IEnumerable GetBackOfficeMembersFields() 36 | { 37 | return new List(base.GetBackOfficeMembersFields()) { "parentID" }; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Components/ProductView/ProductViewViewComponent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Components.ProoductView 5 | { 6 | public class ProductViewViewComponent : ViewComponent 7 | { 8 | public IViewComponentResult Invoke() 9 | { 10 | List products = new List() { 11 | "Product 1", "Product 2", "Product 3", "Product 4", "Product 5" 12 | }; 13 | 14 | return View(products); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Controllers/Api/PeopleController.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Umbraco.Cms.Core.Web; 4 | using Umbraco.Cms.Web.Common.Controllers; 5 | using Umbraco.Cms.Web.Common.PublishedModels; 6 | 7 | namespace Umbraco.Docs.Samples.Web.Controllers.Api; 8 | 9 | public class PeopleController : UmbracoApiController 10 | { 11 | private readonly IUmbracoContextAccessor _umbracoContextAccessor; 12 | 13 | public PeopleController(IUmbracoContextAccessor umbracoContextAccessor) 14 | { 15 | _umbracoContextAccessor = umbracoContextAccessor; 16 | 17 | } 18 | 19 | [HttpGet] 20 | public ActionResult> GetAll() 21 | { 22 | if (_umbracoContextAccessor.TryGetUmbracoContext(out IUmbracoContext? context) == false) 23 | { 24 | return this.Problem("unable to get content"); 25 | } 26 | 27 | if (context.Content == null) 28 | { 29 | return this.Problem("Content Cache is null"); 30 | } 31 | 32 | var personContentType = context.Content.GetContentType(Person.ModelTypeAlias); 33 | Debug.Assert(context.Content.HasContent()); 34 | var personNodes = (context.Content.GetAtRoot() 35 | .First() 36 | .FirstChild() 37 | .Children() ?? Array.Empty()) 38 | .Select(p => p.Name); 39 | return personContentType == null 40 | ? this.Problem("Person Content Type is null") 41 | : Ok(personNodes); 42 | } 43 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Controllers/DefaultController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.ViewEngines; 3 | using Umbraco.Cms.Core.Models; 4 | using Umbraco.Cms.Core.Web; 5 | using Umbraco.Cms.Web.Common.Controllers; 6 | 7 | namespace Umbraco.Docs.Samples.Web.Controllers 8 | { 9 | public class DefaultController : RenderController 10 | { 11 | public DefaultController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) : base(logger, compositeViewEngine, umbracoContextAccessor) 12 | { 13 | } 14 | 15 | [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] 16 | public override IActionResult Index() 17 | { 18 | return CurrentTemplate(new ContentModel(CurrentPage)); 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Controllers/PersonController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.ViewEngines; 3 | using Newtonsoft.Json.Linq; 4 | using Umbraco.Cms.Core.Models; 5 | using Umbraco.Cms.Core.Models.PublishedContent; 6 | using Umbraco.Cms.Core.Web; 7 | using Umbraco.Cms.Web.Common.Controllers; 8 | 9 | namespace Umbraco.Docs.Samples.Web.Controllers; 10 | 11 | public class PersonViewModel : ContentModel { 12 | public bool IsYes { get; } 13 | public string? IsYesImage { get; } 14 | 15 | public PersonViewModel(IPublishedContent? content, bool isYes, string? isYesImage) : base(content) 16 | { 17 | IsYes = isYes; 18 | IsYesImage = isYesImage; 19 | } 20 | } 21 | 22 | public class PersonController : RenderController 23 | { 24 | public PersonController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) 25 | : base(logger, compositeViewEngine, umbracoContextAccessor) 26 | { 27 | } 28 | 29 | public override IActionResult Index() 30 | { 31 | // you are in control here! 32 | 33 | var client = new HttpClient(); 34 | var response = client.GetAsync("https://yesno.wtf/api").GetAwaiter().GetResult(); 35 | response.EnsureSuccessStatusCode(); 36 | var responseBody = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); 37 | var json = JObject.Parse(responseBody); 38 | var isYes = json["answer"]?.ToString() == "yes"; 39 | var isYesImage = json["image"]?.ToString(); 40 | 41 | // return a 'model' to the selected template/view for this page. 42 | return CurrentTemplate(new PersonViewModel(CurrentPage, isYes, isYesImage)); 43 | } 44 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/CustomIndexing/ConfigureProductIndexOptions.cs: -------------------------------------------------------------------------------- 1 | using Examine; 2 | using Examine.Lucene; 3 | using Lucene.Net.Analysis.Standard; 4 | using Lucene.Net.Index; 5 | using Lucene.Net.Util; 6 | using Microsoft.Extensions.Options; 7 | using Umbraco.Cms.Core.Configuration.Models; 8 | using Umbraco.Cms.Core.Scoping; 9 | using Umbraco.Cms.Core.Services; 10 | using Umbraco.Cms.Infrastructure.Examine; 11 | 12 | namespace Umbraco.Docs.Samples.Web.CustomIndexing 13 | { 14 | public class ConfigureProductIndexOptions : IConfigureNamedOptions 15 | { 16 | private readonly IOptions _settings; 17 | private readonly IPublicAccessService _publicAccessService; 18 | private readonly IScopeProvider _scopeProvider; 19 | 20 | public ConfigureProductIndexOptions( 21 | IOptions settings, 22 | IPublicAccessService publicAccessService, 23 | IScopeProvider scopeProvider) 24 | { 25 | _settings = settings; 26 | _publicAccessService = publicAccessService; 27 | _scopeProvider = scopeProvider; 28 | } 29 | 30 | public void Configure(string name, LuceneDirectoryIndexOptions options) 31 | { 32 | if (name.Equals("ProductIndex")) 33 | { 34 | options.Analyzer = new StandardAnalyzer(LuceneVersion.LUCENE_48); 35 | 36 | options.FieldDefinitions = new( 37 | new("id", FieldDefinitionTypes.Integer), 38 | new("name", FieldDefinitionTypes.FullText), 39 | //the examine dashboard uses nodeName in search results 40 | new("nodeName", FieldDefinitionTypes.InvariantCultureIgnoreCase), 41 | //__Published and path both required if using the ContentValueSetValidator 42 | new("__Published", FieldDefinitionTypes.Raw), 43 | new("path",FieldDefinitionTypes.InvariantCultureIgnoreCase) 44 | ); 45 | 46 | options.UnlockIndex = true; 47 | 48 | //ContentValueSetValidator - requires Path, and ParentId 49 | options.Validator = new ContentValueSetValidator(true,false, _publicAccessService, _scopeProvider, includeItemTypes: new[] { "product" }); 50 | 51 | if (_settings.Value.LuceneDirectoryFactory == LuceneDirectoryFactory.SyncedTempFileSystemDirectoryFactory) 52 | { 53 | // if this directory factory is enabled then a snapshot deletion policy is required 54 | options.IndexDeletionPolicy = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy()); 55 | } 56 | } 57 | } 58 | 59 | public void Configure(LuceneDirectoryIndexOptions options) 60 | { 61 | throw new System.NotImplementedException(); 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/CustomIndexing/ExamineComposer.cs: -------------------------------------------------------------------------------- 1 | using Examine; 2 | using Umbraco.Cms.Core.Composing; 3 | using Umbraco.Cms.Infrastructure.Examine; 4 | 5 | namespace Umbraco.Docs.Samples.Web.CustomIndexing 6 | { 7 | public class ExamineComposer : IComposer 8 | { 9 | public void Compose(IUmbracoBuilder builder) 10 | { 11 | 12 | builder.Services.AddExamineLuceneIndex("ProductIndex"); 13 | 14 | builder.Services.ConfigureOptions(); 15 | 16 | builder.Services.AddSingleton(); 17 | 18 | builder.Services.AddSingleton(); 19 | 20 | 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/CustomIndexing/ProductIndex.cs: -------------------------------------------------------------------------------- 1 | using Examine.Lucene; 2 | using Microsoft.Extensions.Options; 3 | using Umbraco.Cms.Core.Services; 4 | using Umbraco.Cms.Infrastructure.Examine; 5 | 6 | namespace Umbraco.Docs.Samples.Web.CustomIndexing 7 | { 8 | public class ProductIndex : UmbracoExamineIndex 9 | { 10 | public ProductIndex( 11 | ILoggerFactory loggerFactory, 12 | string name, 13 | IOptionsMonitor indexOptions, 14 | Cms.Core.Hosting.IHostingEnvironment hostingEnvironment, 15 | IRuntimeState runtimeState) : base(loggerFactory, 16 | name, 17 | indexOptions, 18 | hostingEnvironment, 19 | runtimeState) 20 | { 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/CustomIndexing/ProductIndexPopulator.cs: -------------------------------------------------------------------------------- 1 | using Examine; 2 | using Umbraco.Cms.Core.Services; 3 | using Umbraco.Cms.Infrastructure.Examine; 4 | 5 | namespace Umbraco.Docs.Samples.Web.CustomIndexing 6 | { 7 | public class ProductIndexPopulator : IndexPopulator 8 | { 9 | private readonly IContentService _contentService; 10 | private readonly ProductIndexValueSetBuilder _productIndexValueSetBuilder; 11 | 12 | public ProductIndexPopulator(IContentService contentService, ProductIndexValueSetBuilder productIndexValueSetBuilder) 13 | { 14 | _contentService = contentService; 15 | _productIndexValueSetBuilder = productIndexValueSetBuilder; 16 | RegisterIndex("ProductIndex"); 17 | } 18 | protected override void PopulateIndexes(IReadOnlyList indexes) 19 | { 20 | foreach (var index in indexes) 21 | { 22 | var roots = _contentService.GetRootContent(); 23 | 24 | index.IndexItems(_productIndexValueSetBuilder.GetValueSets(roots.ToArray())); 25 | 26 | foreach (var root in roots) 27 | { 28 | var valueSets = _productIndexValueSetBuilder.GetValueSets(_contentService.GetPagedDescendants(root.Id, 0, Int32.MaxValue, out _).ToArray()); 29 | index.IndexItems(valueSets); 30 | } 31 | } 32 | 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/CustomIndexing/ProductIndexValueSetBuilder.cs: -------------------------------------------------------------------------------- 1 | using Examine; 2 | using Umbraco.Cms.Core.Models; 3 | using Umbraco.Cms.Infrastructure.Examine; 4 | 5 | namespace Umbraco.Docs.Samples.Web.CustomIndexing 6 | { 7 | public class ProductIndexValueSetBuilder : IValueSetBuilder 8 | { 9 | public IEnumerable GetValueSets(params IContent[] contents) 10 | { 11 | foreach (var content in contents) 12 | { 13 | var indexValues = new Dictionary 14 | { 15 | ["name"] = content.Name, 16 | ["id"] = content.Id, 17 | // nodeName used in the Examine Dashboard backoffice search results 18 | ["nodeName"] = content.Name, 19 | //__Published and path are required if using core ContentValueSetValidator to apply a Validation option to filter results 20 | ["__Published"] = content.Published ? "y" : "n", 21 | ["path"] = content.Path 22 | 23 | }; 24 | 25 | yield return new ValueSet(content.Id.ToString(), "content",content.ContentType.Alias,indexValues); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Dashboards/MyCustomDashboard.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Composing; 2 | using Umbraco.Cms.Core.Dashboards; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Dashboards 5 | { 6 | [Weight(-10)] 7 | public class MyCustomDashboard : IDashboard 8 | { 9 | public string Alias => "myCustomDashboard"; 10 | 11 | public string[] Sections => new[] 12 | { 13 | Cms.Core.Constants.Applications.Content, 14 | Cms.Core.Constants.Applications.Members, 15 | Cms.Core.Constants.Applications.Settings 16 | }; 17 | 18 | public string View => "/App_Plugins/MyCustomDashboard/dashboard.html"; 19 | 20 | public IAccessRule[] AccessRules 21 | { 22 | get 23 | { 24 | var rules = new IAccessRule[] 25 | { 26 | new AccessRule {Type = AccessRuleType.Deny, Value = Cms.Core.Constants.Security.TranslatorGroupAlias}, 27 | new AccessRule {Type = AccessRuleType.Grant, Value = Cms.Core.Constants.Security.AdminGroupAlias} 28 | }; 29 | return rules; 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Dashboards/MyDashboardComposer.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Composing; 2 | using Umbraco.Cms.Core.Dashboards; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Dashboards 5 | { 6 | public class MyDashboardComposer : IComposer 7 | { 8 | public void Compose(IUmbracoBuilder builder) 9 | { 10 | builder.Dashboards() 11 | // Remove the default 12 | .Remove() 13 | // Add the overridden one 14 | .Add(); 15 | } 16 | } 17 | 18 | // overridden redirect dashboard with custom rules 19 | public class MyRedirectUrlDashboard : RedirectUrlDashboard, IDashboard 20 | { 21 | // override explicit implementation 22 | IAccessRule[] IDashboard.AccessRules { get; } = new IAccessRule[] 23 | { 24 | new AccessRule {Type = AccessRuleType.Deny, Value = "writer"}, 25 | new AccessRule {Type = AccessRuleType.Grant, Value = Umbraco.Cms.Core.Constants.Security.AdminGroupAlias} 26 | }; 27 | } 28 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Dashboards/RemoveDashboard.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Composing; 2 | using Umbraco.Cms.Core.Dashboards; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Dashboards 5 | { 6 | public class RemoveDashboard : IComposer 7 | { 8 | public void Compose(IUmbracoBuilder builder) 9 | { 10 | builder.Dashboards().Remove(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/AllUnPublishedCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#unpublished 7 | public class AllUnPublishedCheck: INotificationHandler 8 | { 9 | public void Handle(ContentUnpublishedNotification notification) 10 | { 11 | foreach (var unPublishedEntity in notification.UnpublishedEntities) 12 | { 13 | // complete unpublish of entity, all cultures 14 | notification.Messages.Add(new EventMessage("Docs Samples Info: ContentUnpublishedNotification", 15 | $"{unPublishedEntity.Name} was completely unpublished, all cultures", 16 | EventMessageType.Warning)); 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/AllUnPublishingCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#unpublished 7 | public class AllUnPublishingCheck: INotificationHandler 8 | { 9 | public void Handle(ContentUnpublishingNotification notification) 10 | { 11 | foreach (var unPublishedEntity in notification.UnpublishedEntities) 12 | { 13 | // complete unpublishing of entity, all cultures 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CulturePublishedCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#published 7 | public class CulturePublishedCheck: INotificationHandler 8 | { 9 | public void Handle(ContentPublishedNotification notification) 10 | { 11 | foreach (var publishedEntity in notification.PublishedEntities) 12 | { 13 | var publishedCultures = publishedEntity.AvailableCultures 14 | .Where(culture => notification.HasPublishedCulture(publishedEntity, culture)).ToList(); 15 | 16 | var unPublishedCultures = publishedEntity.AvailableCultures 17 | .Where(culture => notification.HasUnpublishedCulture(publishedEntity, culture)).ToList(); 18 | // or 19 | if (notification.HasPublishedCulture(publishedEntity, "da-DK")) 20 | { 21 | // Welcome back DK! 22 | } 23 | 24 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#icontent-helpers 25 | if (publishedEntity.IsCultureAvailable("da-dk")) 26 | { 27 | 28 | } 29 | 30 | if (publishedEntity.IsCultureEdited("da-dk")) 31 | { 32 | 33 | } 34 | 35 | if (publishedEntity.IsCulturePublished("da-dk")) 36 | { 37 | 38 | } 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CulturePublishingCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#publishing 7 | public class CulturePublishingCheck: INotificationHandler 8 | { 9 | public void Handle(ContentPublishingNotification notification) 10 | { 11 | foreach (var publishedEntity in notification.PublishedEntities) 12 | { 13 | var publishingCultures = publishedEntity.AvailableCultures 14 | .Where(culture => notification.IsPublishingCulture(publishedEntity, culture)).ToList(); 15 | 16 | var unPublishingCultures = publishedEntity.AvailableCultures 17 | .Where(culture => notification.IsUnpublishingCulture(publishedEntity, culture)).ToList(); 18 | // or 19 | if (notification.IsPublishingCulture(publishedEntity, "da-DK")) 20 | { 21 | // Welcome back DK! 22 | } 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CultureSavedCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#saved 7 | public class CultureSavedCheck: INotificationHandler 8 | { 9 | public void Handle(ContentSavedNotification notification) 10 | { 11 | foreach (var entity in notification.SavedEntities) 12 | { 13 | // Cultures being saved 14 | var savingCultures = entity.AvailableCultures 15 | .Where(culture => notification.HasSavedCulture(entity, culture)).ToList(); 16 | // or 17 | if (notification.HasSavedCulture(entity, "en-GB")) 18 | { 19 | // Do things differently if the UK version of the page is being saved. 20 | } 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CultureSavingCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#saving 7 | public class CultureSavingCheck: INotificationHandler 8 | { 9 | public void Handle(ContentSavingNotification notification) 10 | { 11 | foreach (var entity in notification.SavedEntities) 12 | { 13 | // Cultures being saved 14 | var savingCultures = entity.AvailableCultures 15 | .Where(culture => notification.IsSavingCulture(entity, culture)).ToList(); 16 | // or 17 | if (notification.IsSavingCulture(entity, "en-GB")) 18 | { 19 | // Do things differently if the UK version of the page is being saved. 20 | } 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CultureUnpublishedCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#unpublished 7 | public class CultureUnpublishedCheck: INotificationHandler 8 | { 9 | public void Handle(ContentPublishedNotification notification) 10 | { 11 | foreach (var publishedEntity in notification.PublishedEntities) 12 | { 13 | if (notification.HasUnpublishedCulture(publishedEntity, "da-DK")) 14 | { 15 | // Bye bye DK! 16 | } 17 | 18 | if (notification.HasUnpublishedCulture(publishedEntity,"en-US")) 19 | { 20 | notification.Messages.Add(new EventMessage("Docs Samples Info: ContentPublishedNotification", 21 | $"{publishedEntity.Name} was unpublished for en-US", 22 | EventMessageType.Warning)); 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/CultureUnpublishingCheck.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications#unpublishing 7 | public class CultureUnpublishingCheck: INotificationHandler 8 | { 9 | public void Handle(ContentPublishingNotification notification) 10 | { 11 | foreach (var publishedEntity in notification.PublishedEntities) 12 | { 13 | if (notification.IsUnpublishingCulture(publishedEntity, "da-DK")) 14 | { 15 | // Bye bye DK! 16 | } 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/DontShout.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | 4 | namespace Umbraco.Docs.Samples.Web.Notifications 5 | { 6 | // https://our.umbraco.com/documentation/Reference/Notifications/Contentservice-Notifications 7 | public class DontShout: INotificationHandler 8 | { 9 | public void Handle(ContentPublishingNotification notification) 10 | { 11 | foreach (var contentItem in notification.PublishedEntities) 12 | { 13 | if (contentItem.ContentType.Alias.Equals("blogpost")) 14 | { 15 | var blogPostTitle = contentItem.GetValue("pageTitle"); 16 | 17 | if (!string.IsNullOrWhiteSpace(blogPostTitle)) 18 | { 19 | if (blogPostTitle.Equals(blogPostTitle.ToUpper())) 20 | { 21 | notification.Cancel = true; 22 | notification.CancelOperation(new EventMessage("Corporate style guideline infringement", 23 | "Don't put the blog post title in upper case, no need to shout! Publishing was cancelled", 24 | EventMessageType.Error)); 25 | } 26 | } 27 | } 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/EditorSendingContentNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Models.ContentEditing; 3 | using Umbraco.Cms.Core.Notifications; 4 | 5 | namespace Umbraco.Docs.Samples.Web.Notifications 6 | { 7 | // https://our.umbraco.com/Documentation/Reference/Notifications/EditorModel-Notifications/ 8 | public class EditorSendingContentNotificationHandler : INotificationHandler 9 | { 10 | public void Handle(SendingContentNotification notification) 11 | { 12 | if (notification.Content.ContentTypeAlias.Equals("blogpost")) 13 | { 14 | // Access the property you want to pre-populate 15 | // each content item can have 'variations' - each variation is represented by the `ContentVariantDisplay` class. 16 | // if your site uses variants, then you need to decide whether to set the default value for all variants or a specific variant 17 | // eg. set by variant name: 18 | // var variant = notification.Content.Variants.FirstOrDefault(f => f.Name == "specificVariantName"); 19 | // OR loop through all the variants: 20 | foreach (var variant in notification.Content.Variants) 21 | { 22 | // Check if variant is a 'new variant' 23 | // we only want to set the default value when the content item is first created 24 | if (variant.State == ContentSavedState.NotCreated) 25 | { 26 | // each variant has an IEnumerable of 'Tabs' (property groupings) 27 | // and each of these contain an IEnumerable of `ContentPropertyDisplay` properties 28 | var pubDateProperty = variant.Tabs.SelectMany(f => f.Properties) 29 | .FirstOrDefault(f => f.Alias.InvariantEquals("publishDate")); 30 | if (pubDateProperty is not null) 31 | { 32 | // set default value of the publish date property if it exists 33 | pubDateProperty.Value = DateTime.UtcNow; 34 | } 35 | } 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/EditorSendingMemberNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core; 2 | using Umbraco.Cms.Core.Events; 3 | using Umbraco.Cms.Core.Notifications; 4 | using Umbraco.Cms.Core.Services; 5 | 6 | namespace Umbraco.Docs.Samples.Web.Notifications 7 | { 8 | public class EditorSendingMemberNotificationHandler : INotificationHandler 9 | { 10 | private readonly IMemberGroupService _memberGroupService; 11 | 12 | public EditorSendingMemberNotificationHandler(IMemberGroupService memberGroupService) 13 | { 14 | _memberGroupService = memberGroupService; 15 | } 16 | 17 | public void Handle(SendingMemberNotification notification) 18 | { 19 | var isNew = !int.TryParse(notification.Member.Id?.ToString(), out int id) || id == 0; 20 | 21 | // We only want to set the default member group when the member is initially created, eg doesn't have an Id yet 22 | if (isNew is false) 23 | { 24 | return; 25 | } 26 | 27 | // Set a default value member group for the member type `Member` 28 | if (notification.Member.ContentTypeAlias.Equals("Member")) 29 | { 30 | var memberGroup = _memberGroupService.GetByName("Customer"); 31 | if (memberGroup is null) 32 | { 33 | return; 34 | } 35 | 36 | // Find member group property on member model 37 | var property = notification.Member.Properties.FirstOrDefault(x => 38 | x.Alias.Equals($"{Constants.PropertyEditors.InternalGenericPropertiesPrefix}membergroup")); 39 | 40 | if (property is not null) 41 | { 42 | // Assign a default value for member group property 43 | property.Value = new Dictionary 44 | { 45 | {memberGroup.Name, true} 46 | }; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/RoomCleanedNotification.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Notifications; 2 | 3 | namespace Umbraco.Docs.Samples.Web.Notifications 4 | { 5 | // https://our.umbraco.com/documentation/Reference/Notifications/Creating-And-Publishing-Notifications 6 | public class RoomCleanedNotification : INotification 7 | { 8 | public int ItemsDeleted { get; } 9 | public RoomCleanedNotification(int itemsDeleted) 10 | { 11 | ItemsDeleted = itemsDeleted; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/RoomCleanedNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | 3 | namespace Umbraco.Docs.Samples.Web.Notifications 4 | { 5 | // https://our.umbraco.com/documentation/Reference/Notifications/Creating-And-Publishing-Notifications 6 | public class RoomCleanedNotificationHandler : INotificationHandler 7 | { 8 | public void Handle(RoomCleanedNotification notification) 9 | { 10 | var numberofItems = notification.ItemsDeleted; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/SendingAllowedChildrenNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using Umbraco.Cms.Core.Events; 3 | using Umbraco.Cms.Core.Notifications; 4 | using Umbraco.Cms.Web.Common.PublishedModels; 5 | 6 | namespace Umbraco.Docs.Samples.Web.Notifications 7 | { 8 | // https://our.umbraco.com/documentation/Reference/Notifications/SendingAllowedChildrenNotification/ 9 | internal class SendingAllowedChildrenNotificationHandler : INotificationHandler 10 | { 11 | public void Handle(SendingAllowedChildrenNotification notification) 12 | { 13 | var queryStringCollection = HttpUtility.ParseQueryString(notification.UmbracoContext.OriginalRequestUrl.Query); 14 | 15 | const string contentIdKey = "contentId"; 16 | 17 | if (!queryStringCollection.ContainsKey(contentIdKey)) 18 | { 19 | return; 20 | } 21 | var contentId = queryStringCollection[contentIdKey].TryConvertTo().ResultOr(-1); 22 | if (contentId == -1) 23 | { 24 | return; 25 | } 26 | 27 | var content = notification.UmbracoContext.Content?.GetById(true, contentId); 28 | if (content == null) 29 | { 30 | return; 31 | } 32 | // allowed children as configured in the backoffice 33 | var allowedChildren = notification.Children.ToList(); 34 | if (content.ChildrenForAllCultures != null) 35 | { 36 | // get all children of current page. 37 | var childNodes = content.ChildrenForAllCultures.ToList(); 38 | // if there is a people page already created, then don't allow it anymore 39 | if (childNodes.Any(x => x.ContentType.Alias == People.ModelTypeAlias)) 40 | { 41 | allowedChildren.RemoveAll(x => x.Alias == People.ModelTypeAlias); 42 | } 43 | } 44 | // update the allowed children. 45 | notification.Children = allowedChildren; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/TreeNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Events; 2 | using Umbraco.Cms.Core.Notifications; 3 | using Umbraco.Cms.Core.Security; 4 | 5 | namespace Umbraco.Docs.Samples.Web.Notifications; 6 | 7 | // https://docs.umbraco.com/umbraco-cms/extending/section-trees/trees#menurenderingnotification 8 | internal class TreeNotificationHandler : INotificationHandler 9 | { 10 | private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; 11 | public TreeNotificationHandler(IBackOfficeSecurityAccessor backOfficeSecurityAccessor) 12 | { 13 | _backOfficeSecurityAccessor = backOfficeSecurityAccessor; 14 | } 15 | 16 | public void Handle(MenuRenderingNotification notification) 17 | { 18 | // this example will add a custom menu item for all admin users 19 | // for all content tree nodes 20 | if (notification.TreeAlias.Equals("content") && _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser != null && _backOfficeSecurityAccessor.BackOfficeSecurity.CurrentUser.IsAdmin()) 21 | { 22 | // Creates a menu action that will open /umbraco/currentSection/itemAlias.html 23 | var menuItem = new Umbraco.Cms.Core.Models.Trees.MenuItem("itemAlias", "Item name"); 24 | 25 | // optional, if you don't want to follow the naming conventions, but do want to use a angular view 26 | // you can also use a direct path "../App_Plugins/my/long/url/to/view.html" 27 | menuItem.AdditionalData.Add("actionView", "my/long/url/to/view.html"); 28 | 29 | // sets the icon to icon-wine-glass 30 | menuItem.Icon = "wine-glass"; 31 | // insert at index 5 32 | notification.Menu.Items.Insert(5, menuItem); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Notifications/UmbracoBuilderNotificationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Notifications; 2 | 3 | namespace Umbraco.Docs.Samples.Web.Notifications 4 | { 5 | public static class UmbracoBuilderNotificationExtensions 6 | { 7 | // https://our.umbraco.com/documentation/Reference/Notifications/#registering-many-notification-handlers 8 | public static IUmbracoBuilder AddDocsSamplesNotifications(this IUmbracoBuilder builder) 9 | { 10 | builder 11 | .AddNotificationHandler() 12 | .AddNotificationHandler() 13 | .AddNotificationHandler() 14 | .AddNotificationHandler() 15 | .AddNotificationHandler() 16 | .AddNotificationHandler() 17 | .AddNotificationHandler() 18 | .AddNotificationHandler() 19 | .AddNotificationHandler() 20 | .AddNotificationHandler() 21 | .AddNotificationHandler() 22 | .AddNotificationHandler() 23 | .AddNotificationHandler(); 24 | 25 | return builder; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | using Umbraco.Cms.Web.Common.Hosting; 4 | 5 | namespace Umbraco.Docs.Samples.Web 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | => CreateHostBuilder(args) 11 | .Build() 12 | .Run(); 13 | 14 | public static IHostBuilder CreateHostBuilder(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .ConfigureUmbracoDefaults() 17 | .ConfigureWebHostDefaults(webBuilder => 18 | { 19 | webBuilder.UseStaticWebAssets(); 20 | webBuilder.UseStartup(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:47517", 8 | "sslPort": 44361 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "Umbraco.Docs.Samples.Web": { 20 | "commandName": "Project", 21 | "dotnetRunMessages": true, 22 | "launchBrowser": true, 23 | "applicationUrl": "https://localhost:44361;http://localhost:47517", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Property-Editors-Add-Values/CreateImageCropperValuesController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Newtonsoft.Json; 3 | using Umbraco.Cms.Core.Models.PublishedContent; 4 | using Umbraco.Cms.Core.PropertyEditors; 5 | using Umbraco.Cms.Core.PropertyEditors.ValueConverters; 6 | using Umbraco.Cms.Core.PublishedCache; 7 | using Umbraco.Cms.Core.Services; 8 | using Umbraco.Cms.Web.Common.Controllers; 9 | using Umbraco.Cms.Web.Common.PublishedModels; 10 | 11 | namespace Umbraco.Docs.Samples.Web.Property_Editors_Add_Values 12 | { 13 | public class CreateImageCropperValuesController : UmbracoApiController 14 | { 15 | private readonly IContentService _contentService; 16 | private readonly IMediaService _mediaService; 17 | private readonly MediaUrlGeneratorCollection _mediaUrlGeneratorCollection; 18 | private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; 19 | 20 | 21 | public CreateImageCropperValuesController(IContentService contentService, IMediaService mediaService, MediaUrlGeneratorCollection mediaUrlGeneratorCollection, IPublishedSnapshotAccessor publishedSnapshotAccessor) 22 | { 23 | _contentService = contentService; 24 | _mediaService = mediaService; 25 | _mediaUrlGeneratorCollection = mediaUrlGeneratorCollection; 26 | _publishedSnapshotAccessor = publishedSnapshotAccessor; 27 | } 28 | 29 | // /Umbraco/Api/CreateImageCropperValues/CreateImageCropperValues 30 | [HttpGet] 31 | public ActionResult CreateImageCropperValues() 32 | { 33 | // Create a variable for the GUID of the page you want to update 34 | var guid = Guid.Parse("4e96411a-b8e1-435f-9322-2faee30ef5f2"); 35 | 36 | // Get the page using the GUID you've defined 37 | var content = _contentService.GetById(guid); // ID of your page 38 | 39 | // Create a variable for the GUID of the media item you want to use 40 | var mediaKey = Guid.Parse("cf1ab8dc-ad0f-4a8e-974b-87b84777b0d6"); 41 | 42 | // Get the desired media file 43 | var media = _mediaService.GetById(mediaKey); 44 | 45 | // Create a variable for the image cropper and set the source 46 | var cropper = new ImageCropperValue {Src = media.GetUrl("umbracoFile", _mediaUrlGeneratorCollection)}; 47 | 48 | // Serialize the image cropper value 49 | var cropperValue = JsonConvert.SerializeObject(cropper); 50 | 51 | // Get the alias of the 'cropper' property 52 | var testCropperAlias = Product.GetModelPropertyType(_publishedSnapshotAccessor, x => x.TestCropper)?.Alias; 53 | 54 | // Set the value of the property with alias 'cropper' 55 | if (content != null && !string.IsNullOrWhiteSpace(testCropperAlias)) 56 | { 57 | // Set the value of the cropper 58 | content.SetValue("testCropper", cropperValue, "en-US"); 59 | 60 | // Set the value of the cropper using the 'testCropperAlias' variable 61 | content.SetValue(testCropperAlias, cropperValue, "en-US"); 62 | } 63 | 64 | 65 | return _contentService.Save(content).Success.ToString(); 66 | } 67 | 68 | internal Dictionary GetCropUrls(IPublishedContent image) 69 | { 70 | //Instantiate the dictionary that I will return with "Crop alias" and "Cropped URL" 71 | Dictionary cropUrls = new Dictionary(); 72 | 73 | if (image.HasValue("umbracoFile")) 74 | { 75 | var imageCropper = image.Value("umbracoFile"); 76 | 77 | if (imageCropper != null && imageCropper.Crops != null) 78 | { 79 | foreach (var crop in imageCropper.Crops) 80 | { 81 | //Get the cropped URL and add it to the dictionary that I will return 82 | if (!string.IsNullOrWhiteSpace(crop.Alias)) 83 | { 84 | var cropUrl = image.GetCropUrl(crop.Alias); 85 | if (!string.IsNullOrEmpty(cropUrl)) 86 | { 87 | cropUrls.Add(crop.Alias, cropUrl); 88 | } 89 | } 90 | } 91 | } 92 | } 93 | 94 | return cropUrls; 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/RecurringHostedService/CleanUpYourRoom.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core; 2 | using Umbraco.Cms.Core.Logging; 3 | using Umbraco.Cms.Core.Services; 4 | using Umbraco.Cms.Core.Sync; 5 | using Umbraco.Cms.Infrastructure.HostedServices; 6 | using Umbraco.Cms.Infrastructure.Scoping; 7 | using Umbraco.Docs.Samples.Web.Notifications; 8 | 9 | namespace Umbraco.Docs.Samples.Web.RecurringHostedService 10 | { 11 | // https://our.umbraco.com/documentation/reference/Scheduling/ 12 | public class CleanUpYourRoom : RecurringHostedServiceBase 13 | { 14 | private readonly IRuntimeState _runtimeState; 15 | private readonly IContentService _contentService; 16 | private readonly IServerRoleAccessor _serverRoleAccessor; 17 | private readonly IProfilingLogger _profilingLogger; 18 | private readonly ILogger _logger; 19 | private readonly IScopeProvider _scopeProvider; 20 | 21 | private static TimeSpan HowOftenWeRepeat => TimeSpan.FromMinutes(5); 22 | private static TimeSpan DelayBeforeWeStart => TimeSpan.FromMinutes(1); 23 | 24 | public CleanUpYourRoom( 25 | IRuntimeState runtimeState, 26 | IContentService contentService, 27 | IServerRoleAccessor serverRoleAccessor, 28 | IProfilingLogger profilingLogger, 29 | ILogger logger, 30 | IScopeProvider scopeProvider) 31 | : base(logger, HowOftenWeRepeat, DelayBeforeWeStart) 32 | { 33 | _runtimeState = runtimeState; 34 | _contentService = contentService; 35 | _serverRoleAccessor = serverRoleAccessor; 36 | _profilingLogger = profilingLogger; 37 | _logger = logger; 38 | _scopeProvider = scopeProvider; 39 | } 40 | 41 | public override Task PerformExecuteAsync(object state) 42 | { 43 | // Don't do anything if the site is not running. 44 | if (_runtimeState.Level != RuntimeLevel.Run) 45 | { 46 | return Task.CompletedTask; 47 | } 48 | 49 | // Do not run the code on subscribers or unknown role servers 50 | // ONLY run for SchedulingPublisher server or Single server roles 51 | switch (_serverRoleAccessor.CurrentServerRole) 52 | { 53 | case ServerRole.Subscriber: 54 | _logger.LogDebug("Does not run on subscriber servers."); 55 | return Task.CompletedTask; // We return Task.CompletedTask to try again as the server role may change! 56 | case ServerRole.Unknown: 57 | _logger.LogDebug("Does not run on servers with unknown role."); 58 | return Task.CompletedTask; // We return Task.CompletedTask to try again as the server role may change! 59 | } 60 | 61 | // Wrap the three content service calls in a scope to do it all in one transaction. 62 | using IScope scope = _scopeProvider.CreateScope(); 63 | 64 | int numberOfThingsInBin = _contentService.CountChildren(Constants.System.RecycleBinContent); 65 | _logger.LogInformation("Go clean your room - {ServerRole}", _serverRoleAccessor.CurrentServerRole); 66 | _logger.LogInformation("You have {NumberOfThingsInTheBin} items to clean", numberOfThingsInBin); 67 | 68 | 69 | if (_contentService.RecycleBinSmells()) 70 | { 71 | // Take out the trash 72 | using (_profilingLogger.TraceDuration("Mum, I am emptying out the bin", 73 | "It's all clean now")) 74 | { 75 | _contentService.EmptyRecycleBin(userId: -1); 76 | 77 | // https://our.umbraco.com/documentation/Reference/Notifications/Creating-And-Publishing-Notifications 78 | // This will only be published when the scope is completed and disposed. 79 | scope.Notifications.Publish(new RoomCleanedNotification(numberOfThingsInBin)); 80 | 81 | } 82 | } 83 | 84 | // Remember to complete the scope when done. 85 | scope.Complete(); 86 | return Task.CompletedTask; 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/RecurringHostedService/UmbracoBuilderHostedServiceExtensions.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Docs.Samples.Web.Notifications; 2 | 3 | namespace Umbraco.Docs.Samples.Web.RecurringHostedService 4 | { 5 | public static class UmbracoBuilderHostedServiceExtensions 6 | { 7 | public static IUmbracoBuilder AddCustomHostedServices(this IUmbracoBuilder builder) 8 | { 9 | builder 10 | .AddNotificationHandler() 11 | .Services.AddHostedService(); 12 | return builder; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Services/MediaServiceSamplesController.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Web.Common.Controllers; 2 | using Umbraco.Cms.Core.Services; 3 | using Umbraco.Cms.Core.IO; 4 | using Umbraco.Cms.Core.Strings; 5 | using Umbraco.Cms.Core.PropertyEditors; 6 | using Umbraco.Cms.Core.Models; 7 | using Umbraco.Cms.Core; 8 | 9 | // This using is unnecessary in this project as it references the Umbraco.Cms NuGet package however it may be required in a Class Library 10 | using Umbraco.Extensions; 11 | 12 | using System.IO; 13 | using Microsoft.AspNetCore.Mvc; 14 | using Microsoft.AspNetCore.Hosting; 15 | 16 | namespace Umbraco.Docs.Samples.Web.Services 17 | { 18 | // https://our.umbraco.com/Documentation/Reference/Management/Services/MediaService/Index/ 19 | public class MediaServiceSamplesController : UmbracoApiController 20 | { 21 | private readonly MediaFileManager _mediaFileManager; 22 | private readonly IShortStringHelper _shortStringHelper; 23 | private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider; 24 | private readonly MediaUrlGeneratorCollection _mediaUrlGeneratorCollection; 25 | private readonly IMediaService _mediaService; 26 | private readonly IWebHostEnvironment _webHostEnvironment; 27 | 28 | 29 | public MediaServiceSamplesController(MediaFileManager mediaFileManager, IShortStringHelper shortStringHelper, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, MediaUrlGeneratorCollection mediaUrlGeneratorCollection, IMediaService mediaService, IWebHostEnvironment webHostEnvironment) 30 | { 31 | _mediaFileManager = mediaFileManager; 32 | _shortStringHelper = shortStringHelper; 33 | _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; 34 | _mediaUrlGeneratorCollection = mediaUrlGeneratorCollection; 35 | _mediaService = mediaService; 36 | _webHostEnvironment = webHostEnvironment; 37 | } 38 | 39 | // /Umbraco/Api/MediaServiceSamples/CreateMediaFolder 40 | [HttpGet] 41 | public ActionResult CreateMediaFolder() 42 | { 43 | // Initialize a new media at the root of the media archive 44 | IMedia folder = _mediaService.CreateMedia("Samples Media Item Folder", Constants.System.Root, Constants.Conventions.MediaTypes.Folder); 45 | 46 | // Save the folder 47 | var result = _mediaService.Save(folder); 48 | 49 | return result.Success.ToString(); 50 | } 51 | 52 | 53 | // /Umbraco/Api/MediaServiceSamples/CreateMediaImage 54 | [HttpGet] 55 | public ActionResult CreateMediaImage() 56 | { 57 | string webRootPath = _webHostEnvironment.WebRootPath; 58 | var path = Path.Combine(webRootPath, "images", "unicorn.jpg"); 59 | 60 | 61 | // Open a new stream to the file 62 | using (Stream stream = System.IO.File.OpenRead(path)) 63 | { 64 | // Initialize a new image at the root of the media archive 65 | IMedia media = _mediaService.CreateMedia("Unicorn", Constants.System.Root, Constants.Conventions.MediaTypes.Image); 66 | // Set the property value (Umbraco will handle the underlying magic) 67 | media.SetValue(_mediaFileManager, _mediaUrlGeneratorCollection, _shortStringHelper, _contentTypeBaseServiceProvider, Constants.Conventions.Media.File, "unicorn.jpg", stream); 68 | 69 | // Save the media 70 | var result = _mediaService.Save(media); 71 | 72 | return result.Success.ToString(); 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Services/SearchService.cs: -------------------------------------------------------------------------------- 1 | using Examine; 2 | using Umbraco.Cms.Core; 3 | using Umbraco.Cms.Core.Models.PublishedContent; 4 | using Umbraco.Cms.Infrastructure.Examine; 5 | 6 | namespace Umbraco.Docs.Samples.Web.Services 7 | { 8 | public class SearchService 9 | { 10 | private readonly IPublishedContentQuery _publishedContentQuery; 11 | private readonly IExamineManager _examineManager; 12 | 13 | public SearchService(IPublishedContentQuery publishedContentQuery, IExamineManager examineManager) 14 | { 15 | _publishedContentQuery = publishedContentQuery; 16 | _examineManager = examineManager; 17 | } 18 | 19 | public IEnumerable Search(string searchTerm) 20 | { 21 | foreach (var result in _publishedContentQuery.Search(searchTerm)) 22 | { 23 | yield return result; 24 | } 25 | } 26 | 27 | public IEnumerable Search(string searchTerm, int skip = 5, int take = 10) 28 | { 29 | foreach (var result in _publishedContentQuery.Search(searchTerm, skip, take, out long totalRecords)) 30 | { 31 | yield return result; 32 | } 33 | } 34 | 35 | //https://our.umbraco.com/documentation/Reference/Querying/IPublishedContentQuery/#searchiqueryexecutor-queryexecutor 36 | public IEnumerable ComplexSearch(string searchTerm) 37 | { 38 | if (!_examineManager.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out IIndex index)) 39 | { 40 | throw new InvalidOperationException($"No index found by name{Constants.UmbracoIndexes.ExternalIndexName}"); 41 | } 42 | 43 | var query = index.Searcher.CreateQuery(IndexTypes.Content); 44 | 45 | var queryExecutor = query.NodeTypeAlias("blogPost").And().ManagedQuery(searchTerm); 46 | 47 | foreach (var result in _publishedContentQuery.Search(queryExecutor)) 48 | { 49 | yield return result; 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | using Umbraco.Docs.Samples.Web.Notifications; 9 | using Umbraco.Docs.Samples.Web.Trees; 10 | using Umbraco.Docs.Samples.Web.RecurringHostedService; 11 | using Umbraco.Docs.Samples.Web.Stylesheets_Javascript; 12 | using Umbraco.Docs.Samples.Web.Tutorials; 13 | using Umbraco.Cms.Web.Website.Controllers; 14 | using Umbraco.Docs.Samples.Web.Controllers; 15 | 16 | namespace Umbraco.Docs.Samples.Web 17 | { 18 | public class Startup 19 | { 20 | private readonly IWebHostEnvironment _env; 21 | private readonly IConfiguration _config; 22 | 23 | /// 24 | /// Initializes a new instance of the class. 25 | /// 26 | /// The Web Host Environment 27 | /// The Configuration 28 | /// 29 | /// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337 30 | /// 31 | public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) 32 | { 33 | _env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment)); 34 | _config = config ?? throw new ArgumentNullException(nameof(config)); 35 | } 36 | 37 | 38 | 39 | /// 40 | /// Configures the services 41 | /// 42 | /// 43 | /// This method gets called by the runtime. Use this method to add services to the container. 44 | /// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 45 | /// 46 | public void ConfigureServices(IServiceCollection services) 47 | { 48 | #pragma warning disable IDE0022 // Use expression body for methods 49 | services.AddUmbraco(_env, _config) 50 | .AddBackOffice() 51 | .AddWebsite() 52 | .AddComposers() 53 | .AddDocsSamplesNotifications() 54 | .ConfigureSearchableTrees() 55 | .AddCustomHostedServices() // Register CleanUpYourRoom 56 | .AddBundles() 57 | .AddTutorials() 58 | .Build(); 59 | #pragma warning restore IDE0022 // Use expression body for methods 60 | 61 | services.Configure(c => 62 | { 63 | c.DefaultControllerType = typeof(DefaultController); 64 | }); 65 | } 66 | 67 | /// 68 | /// Configures the application 69 | /// 70 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 71 | { 72 | if (env.IsDevelopment()) 73 | { 74 | app.UseDeveloperExceptionPage(); 75 | } 76 | else 77 | { 78 | app.UseHsts(options => options.MaxAge(30)); 79 | } 80 | 81 | // https://our.umbraco.com/documentation/Extending/Health-Check/Guides/ 82 | app.UseXfo(options => options.SameOrigin()) 83 | .UseXContentTypeOptions() 84 | .UseXXssProtection(options => options.EnabledWithBlockMode()); 85 | 86 | app.UseUmbraco() 87 | .WithMiddleware(u => 88 | { 89 | u.UseBackOffice(); 90 | u.UseWebsite(); 91 | }) 92 | .WithEndpoints(u => 93 | { 94 | u.UseInstallerEndpoints(); 95 | u.UseBackOfficeEndpoints(); 96 | u.UseWebsiteEndpoints(); 97 | }); 98 | 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Stylesheets-Javascript/CreateBundlesNotificationHandler.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core; 2 | using Umbraco.Cms.Core.Events; 3 | using Umbraco.Cms.Core.Notifications; 4 | using Umbraco.Cms.Core.Services; 5 | using Umbraco.Cms.Core.WebAssets; 6 | 7 | // https://our.umbraco.com/documentation/Fundamentals/Design/Stylesheets-Javascript/#bundling--minification-for-javascript-and-css 8 | namespace Umbraco.Docs.Samples.Web.Stylesheets_Javascript 9 | { 10 | public class CreateBundlesNotificationHandler : INotificationHandler 11 | { 12 | private readonly IRuntimeMinifier _runtimeMinifier; 13 | private readonly IRuntimeState _runtimeState; 14 | 15 | public CreateBundlesNotificationHandler(IRuntimeMinifier runtimeMinifier, IRuntimeState runtimeState) { 16 | _runtimeMinifier = runtimeMinifier; 17 | _runtimeState = runtimeState; 18 | } 19 | public void Handle(UmbracoApplicationStartingNotification notification) 20 | { 21 | if (_runtimeState.Level == RuntimeLevel.Run) 22 | { 23 | _runtimeMinifier.CreateJsBundle("registered-js-bundle", 24 | BundlingOptions.NotOptimizedAndComposite, 25 | new[] { "~/scripts/test-script1.js", "~/scripts/test-script2.js" }); 26 | 27 | _runtimeMinifier.CreateCssBundle("registered-css-bundle", 28 | BundlingOptions.NotOptimizedAndComposite, 29 | new[] { "~/css/test-style.css" }); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Stylesheets-Javascript/UmbracoBuilderNotificationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.Notifications; 2 | 3 | // https://our.umbraco.com/documentation/Fundamentals/Design/Stylesheets-Javascript/#bundling--minification-for-javascript-and-css 4 | namespace Umbraco.Docs.Samples.Web.Stylesheets_Javascript 5 | { 6 | public static class UmbracoBuilderNotificationExtensions 7 | { 8 | public static IUmbracoBuilder AddBundles(this IUmbracoBuilder builder) 9 | { 10 | builder.AddNotificationHandler(); 11 | return builder; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Trees/FavouriteThingsSearchableTree.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core; 2 | using Umbraco.Cms.Core.Models.ContentEditing; 3 | using Umbraco.Cms.Core.Trees; 4 | 5 | // https://our.umbraco.com/Documentation/Extending/Section-Trees/Searchable-Trees/ 6 | 7 | namespace Umbraco.Docs.Samples.Web.Trees 8 | { 9 | public class FavouriteThingsSearchableTree: ISearchableTree 10 | { 11 | public string TreeAlias => "favouriteThingsAlias"; 12 | 13 | public async Task SearchAsync(string query, int pageSize, long pageIndex, string searchFrom = null) 14 | { 15 | // your custom search implementation starts here 16 | Dictionary favouriteThings = new Dictionary(); 17 | favouriteThings.Add(1, "Raindrops on Roses"); 18 | favouriteThings.Add(2, "Whiskers on Kittens"); 19 | favouriteThings.Add(3, "Skys full of Stars"); 20 | favouriteThings.Add(4, "Warm Woolen Mittens"); 21 | favouriteThings.Add(5, "Cream coloured Unicorns"); 22 | favouriteThings.Add(6, "Schnitzel with Noodles"); 23 | 24 | var searchResults = new List(); 25 | 26 | var matchingItems = favouriteThings.Where(f => f.Value.StartsWith(query, true, System.Globalization.CultureInfo.CurrentCulture)); 27 | foreach (var matchingItem in matchingItems) 28 | { 29 | // Making up the Id/Udi for this example! - these would normally be different for each search result. 30 | searchResults.Add(new SearchResultEntity() 31 | { 32 | Id = 12345, 33 | Alias = "favouriteThingItem", 34 | Icon = "icon-favorite", 35 | Key = new Guid("325746a0-ec1e-44e8-8f7b-6e7c4aab36d1"), 36 | Name = matchingItem.Value, 37 | ParentId = -1, 38 | Path = "-1,12345", 39 | Score = 1.0F, 40 | Trashed = false, 41 | Udi = Udi.Create("document", new Guid("325746a0-ec1e-44e8-8f7b-6e7c4aab36d1")) 42 | }); 43 | } 44 | // Set number of search results found 45 | var totalFound = matchingItems.Count(); 46 | // Return your IEnumerable of SearchResultEntity 47 | return new EntitySearchResults(searchResults, totalFound); 48 | 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Trees/FavouriteThingsTreeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Umbraco.Cms.Core; 3 | using Umbraco.Cms.Core.Actions; 4 | using Umbraco.Cms.Core.Events; 5 | using Umbraco.Cms.Core.Models.Trees; 6 | using Umbraco.Cms.Core.Services; 7 | using Umbraco.Cms.Core.Trees; 8 | using Umbraco.Cms.Web.BackOffice.Trees; 9 | 10 | // https://our.umbraco.com/Documentation/Extending/Section-Trees/trees 11 | 12 | namespace Umbraco.Docs.Samples.Web.Trees 13 | { 14 | [Tree("settings", "favouriteThingsAlias", TreeTitle = "Favourite Things Name", TreeGroup = "favouritesGroup", SortOrder = 5)] 15 | public class FavouriteThingsTreeController : TreeController 16 | { 17 | 18 | private readonly IMenuItemCollectionFactory _menuItemCollectionFactory; 19 | 20 | public FavouriteThingsTreeController(ILocalizedTextService localizedTextService, 21 | UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, 22 | IMenuItemCollectionFactory menuItemCollectionFactory, 23 | IEventAggregator eventAggregator) 24 | : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator) 25 | { 26 | _menuItemCollectionFactory = menuItemCollectionFactory ?? throw new ArgumentNullException(nameof(menuItemCollectionFactory)); 27 | } 28 | 29 | protected override ActionResult GetTreeNodes(string id, FormCollection queryStrings) 30 | { 31 | var nodes = new TreeNodeCollection(); 32 | 33 | // check if we're rendering the root node's children 34 | if (id == Constants.System.Root.ToInvariantString()) 35 | { 36 | // you can get your custom nodes from anywhere, and they can represent anything... 37 | Dictionary favouriteThings = new Dictionary(); 38 | favouriteThings.Add(1, "Raindrops on Roses"); 39 | favouriteThings.Add(2, "Whiskers on Kittens"); 40 | favouriteThings.Add(3, "Skys full of Stars"); 41 | favouriteThings.Add(4, "Warm Woolen Mittens"); 42 | favouriteThings.Add(5, "Cream coloured Unicorns"); 43 | favouriteThings.Add(6, "Schnitzel with Noodles"); 44 | 45 | // loop through our favourite things and create a tree item for each one 46 | foreach (var thing in favouriteThings) 47 | { 48 | // add each node to the tree collection using the base CreateTreeNode method 49 | // it has several overloads, using here unique Id of tree item, 50 | // -1 is the Id of the parent node to create, eg the root of this tree is -1 by convention 51 | // - the querystring collection passed into this route 52 | // - the name of the tree node 53 | // - css class of icon to display for the node 54 | // - and whether the item has child nodes 55 | var node = CreateTreeNode(thing.Key.ToString(), "-1", queryStrings, thing.Value, "icon-presentation", false); 56 | nodes.Add(node); 57 | } 58 | } 59 | 60 | return nodes; 61 | } 62 | 63 | protected override ActionResult GetMenuForNode(string id, FormCollection queryStrings) 64 | { 65 | // create a Menu Item Collection to return so people can interact with the nodes in your tree 66 | var menu = _menuItemCollectionFactory.Create(); 67 | 68 | if (id == Constants.System.Root.ToInvariantString()) 69 | { 70 | // root actions, perhaps users can create new items in this tree, or perhaps it's not a content tree, it might be a read only tree, or each node item might represent something entirely different... 71 | // add your menu item actions or custom ActionMenuItems 72 | menu.Items.Add(new CreateChildEntity(LocalizedTextService)); 73 | // add refresh menu item (note no dialog) 74 | menu.Items.Add(new RefreshNode(LocalizedTextService, true)); 75 | } 76 | else 77 | { 78 | // add a delete action to each individual item 79 | menu.Items.Add(LocalizedTextService, true, opensDialog: true); 80 | } 81 | 82 | return menu; 83 | } 84 | 85 | protected override ActionResult CreateRootNode(FormCollection queryStrings) 86 | { 87 | var rootResult = base.CreateRootNode(queryStrings); 88 | if (!(rootResult.Result is null)) 89 | { 90 | return rootResult; 91 | } 92 | 93 | var root = rootResult.Value; 94 | 95 | // set the icon 96 | root.Icon = "icon-hearts"; 97 | // could be set to false for a custom tree with a single node. 98 | root.HasChildren = true; 99 | //url for menu 100 | root.MenuUrl = null; 101 | 102 | return root; 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Trees/UmbracoBuilderSearchableTreeExtensions.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Web.BackOffice.Trees; 2 | 3 | // https://our.umbraco.com/Documentation/Extending/Section-Trees/Searchable-Trees/#example 4 | 5 | namespace Umbraco.Docs.Samples.Web.Trees 6 | { 7 | public static class UmbracoBuilderSearchableTreeExtensions 8 | { 9 | public static IUmbracoBuilder ConfigureSearchableTrees(this IUmbracoBuilder builder) 10 | { 11 | builder.SearchableTrees().Exclude(); 12 | return builder; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Tutorials/ConfigureStaticFileOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | using Microsoft.AspNetCore.Http.Headers; 3 | using Microsoft.Net.Http.Headers; 4 | 5 | using Umbraco.Cms.Core.Configuration.Models; 6 | using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; 7 | 8 | namespace Umbraco.Docs.Samples.Web.Tutorials 9 | { 10 | // https://our.umbraco.com/Documentation/Tutorials/Cache-Static-Assets/ 11 | public class ConfigureStaticFileOptions : IConfigureOptions 12 | { 13 | // These are the extensions of the file types we want to cache (add and remove as you see fit) 14 | private static readonly HashSet _cachedFileExtensions = new(StringComparer.OrdinalIgnoreCase) 15 | { 16 | ".ico", 17 | ".css", 18 | ".js", 19 | ".svg", 20 | ".woff2", 21 | ".jpg" 22 | }; 23 | 24 | private readonly string _backOfficePath; 25 | 26 | public ConfigureStaticFileOptions(IOptions globalSettings, IHostingEnvironment hostingEnvironment) 27 | => _backOfficePath = globalSettings.Value.GetBackOfficePath(hostingEnvironment); 28 | 29 | public void Configure(StaticFileOptions options) 30 | => options.OnPrepareResponse = ctx => 31 | { 32 | // Exclude Umbraco backoffice assets 33 | if (ctx.Context.Request.Path.StartsWithSegments(_backOfficePath)) 34 | { 35 | return; 36 | } 37 | 38 | // Set headers for specific file extensions 39 | var fileExtension = Path.GetExtension(ctx.File.Name); 40 | if (_cachedFileExtensions.Contains(fileExtension)) 41 | { 42 | ResponseHeaders headers = ctx.Context.Response.GetTypedHeaders(); 43 | 44 | // Update or set Cache-Control header 45 | CacheControlHeaderValue cacheControl = headers.CacheControl ?? new CacheControlHeaderValue(); 46 | cacheControl.Public = true; 47 | cacheControl.MaxAge = TimeSpan.FromDays(365); 48 | headers.CacheControl = cacheControl; 49 | } 50 | }; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Tutorials/UmbracoBuilderNotificationExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace Umbraco.Docs.Samples.Web.Tutorials 4 | { 5 | public static class UmbracoBuilderNotificationExtensions 6 | { 7 | public static IUmbracoBuilder AddTutorials(this IUmbracoBuilder builder) 8 | { 9 | builder.Services.AddTransient, ConfigureStaticFileOptions>(); 10 | return builder; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Umbraco.Docs.Samples.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net7.0 4 | enable 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | true 39 | Always 40 | 41 | 42 | true 43 | Always 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | true 60 | true 61 | enable 62 | 63 | 64 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Blog.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @{ 3 | Layout = "Master.cshtml"; 4 | } 5 | 6 | @Html.Partial("~/Views/Partials/SectionHeader.cshtml") 7 | 8 |
9 | 10 |
11 | @await Umbraco.RenderMacroAsync("latestBlogposts", 12 | new 13 | { 14 | numberOfPosts = Model.HowManyPostsShouldBeShown, 15 | startNodeId = Model.Id 16 | }) 17 |
18 | 19 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Blogpost.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Mvc.Rendering 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 3 | @{ 4 | Layout = "master.cshtml"; 5 | } 6 | 7 | @Html.Partial("~/Views/Partials/SectionHeader.cshtml") 8 | 9 |
10 |
11 |
12 |
13 | @Model.CreateDate.ToShortDateString() 14 | 15 | @Html.Partial("~/Views/Partials/CategoryLinks.cshtml", Model.Categories) 16 | 17 |
18 |

@Model.Excerpt

19 | @Html.GetGridHtml(Model, "bodyText", "bootstrap3-fluid") 20 | 21 |
22 |
23 | 24 |
25 |

Cheat sheet - UmbracoHelper

26 |
27 |
.Content(Guid.Parse("ca4249ed-2b23-4337-b522-63cabe5587d1"))
28 |
@Umbraco.Content(Guid.Parse("ca4249ed-2b23-4337-b522-63cabe5587d1")).Name/dd> 29 | 30 |
.Content(Guid.Parse("bc41a208-5c36-4978-a3e2-7cfcfd581980")) as Blogpost
31 |
@((Umbraco.Content(Guid.Parse("bc41a208-5c36-4978-a3e2-7cfcfd581980")) as Blogpost).Name)
32 | 33 |
.Media(Guid.Parse("662af6ca-411a-4c93-a6c7-22c4845698e7"))
34 |
@Umbraco.Media(Guid.Parse("662af6ca-411a-4c93-a6c7-22c4845698e7")).Name
35 | 36 |
.Media(Guid.Parse("662af6ca-411a-4c93-a6c7-22c4845698e7"))
37 |
@((Umbraco.Media(Guid.Parse("662af6ca-411a-4c93-a6c7-22c4845698e7")) as Image).Name)
38 | 39 |
.ContentAtRoot
40 |
@Umbraco.ContentAtRoot().FirstOrDefault().Name
41 | 42 | 43 |
44 |
45 | 46 |
47 |

UmbracoContext

48 |
49 |
.Content.GetByRoute("/")
50 |
@UmbracoContext.Content.GetByRoute("/").Name
51 | 52 |
.InPreviewMode
53 |
@UmbracoContext.InPreviewMode
54 | 55 |
.IsDebug
56 |
@UmbracoContext.IsDebug
57 | 58 |
.Media.GetAtRoot().FirstOrDefault()
59 |
@UmbracoContext.Media.GetAtRoot().FirstOrDefault().Name
60 | 61 |
.CleanedUmbracoUrl
62 |
@UmbracoContext.CleanedUmbracoUrl
63 | 64 |
.OriginalRequestUrl
65 |
@UmbracoContext.OriginalRequestUrl
66 | 67 |
.Domains
68 |
@(string.Join(",", UmbracoContext.Domains.GetAll(true).Select(d=>d.Name)))
69 | 70 |
.PublishedRequest
71 |
@UmbracoContext.PublishedRequest
72 | 73 |
74 |
75 | 76 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.SampleSite; 2 | 3 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 4 | @{ 5 | Layout = "Master.cshtml"; 6 | } 7 | @Html.Partial("~/Views/Partials/SectionHeader.cshtml") 8 |
9 |
10 | 11 |
12 |
13 |

@Model.MapHeader

14 | @Model.MapCoordinates 15 | 16 |
17 | 18 |
19 |

@Model.ContactFormHeader

20 | @Model.ContactIntro 21 | @{ 22 | await Html.RenderPartialAsync("Partials/ContactForm.cshtml", new ContactFormViewModel()); 23 | } 24 |
25 | 26 |
27 |
28 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Home.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @inject IPublishedContentQuery _publishedContentQuery 3 | 4 | @{ 5 | Layout = "Master.cshtml"; 6 | 7 | var backgroundImage = Model.HeroBackgroundImage != null ? Model.HeroBackgroundImage.Url() : String.Empty; 8 | } 9 |
11 |
12 |

@Model.HeroHeader

13 |

@Model.HeroDescription

14 | @if (Model.HeroCtalink != null) 15 | { 16 | 17 | @Model.HeroCtacaption 18 | 19 | } 20 |
21 |
28 | @Html.GetGridHtml(Model, "bodyText", "bootstrap3-fluid") 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 |
37 |

@Model.FooterHeader

38 |

@Model.FooterDescription

39 | 40 | 41 | @Model.FooterCtacaption 42 | 43 | 44 |
45 | 46 |
47 |
48 | 49 | 50 |
51 |

Cheat sheet - Umbraco Helper

52 |
53 |
.Content()
54 |
55 | @{ 56 | var unicorn = Umbraco.Content(Guid.Parse("4e96411a-b8e1-435f-9322-2faee30ef5f2")); 57 | } 58 | @unicorn.Name 59 |
60 | 61 |
.Content() as Product
62 |
63 | @{ 64 | var unicornProduct = Umbraco.Content(Guid.Parse("4e96411a-b8e1-435f-9322-2faee30ef5f2")) as Product; 65 | } 66 | @unicornProduct.Name - @unicornProduct.Price 67 |
68 | 69 |
.Media()
70 |
71 | @{ 72 | var unicornImage = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571")); 73 | } 74 | @unicornImage.Name 75 |
76 | 77 |
.Media() as Type
78 |
79 | @{ 80 | var unicornImageType = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571")) as Image; 81 | } 82 | @unicornImageType.Name 83 |
84 | 85 |
86 |
87 | 88 |
89 |

Cheat sheet - Search

90 |
91 |
_publishedContentQuery.Search("unicorn")
92 |
93 |
    94 | @{ 95 | var searchResults = _publishedContentQuery.Search("unicorn"); 96 | @foreach (var result in searchResults.Where(r => r.Score > 0.05)) 97 | { 98 |
  • @result.Content.Name - @result.Score
  • 99 | } 100 | } 101 |
102 |
103 |
104 |
105 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/MacroPartials/FeaturedProducts.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Cms.Core.Models.PublishedContent 2 | @using Umbraco.Cms.Core.Routing 3 | @using Umbraco.Cms.Web.Common 4 | @using Umbraco.Extensions 5 | @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage 6 | @inject UmbracoHelper Umbraco 7 | @inject IPublishedValueFallback PublishedValueFallback 8 | @inject IPublishedUrlProvider PublishedUrlProvider 9 | @* 10 | This snippet lists the items from a Multinode tree picker, using the pickers default settings. 11 | Content Values stored as xml. 12 | 13 | To get it working with any site's data structure, set the selection equal to the property which has the 14 | multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). 15 | *@ 16 | 17 | @{ var selection = Model.Content.Value>(PublishedValueFallback, "PropertyWithPicker").ToArray(); } 18 | 19 |
    20 | @foreach (var id in selection) 21 | { 22 | var item = Umbraco.Content(id); 23 |
  • 24 | @item.Name 25 |
  • 26 | } 27 |
28 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/MacroPartials/LatestBlogposts.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Http 2 | @using ContentModels = Umbraco.Cms.Web.Common.PublishedModels 3 | @using Microsoft.AspNetCore.Mvc.Rendering 4 | @using Umbraco.Cms.Core.Routing 5 | @using Umbraco.Cms.Web.Common 6 | @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage 7 | @inject UmbracoHelper Umbraco 8 | @inject IPublishedUrlProvider PublishedUrlProvider 9 | @inject IHttpContextAccessor HttpContextAccessor 10 | @{ 11 | var startNodeId = Model.MacroParameters["startNodeId"] ?? Model.Content.Id; 12 | 13 | 14 | var numberOfMorePosts = Model.GetParameterValue("numberOfPosts"); 15 | } 16 | 17 | @if (startNodeId != null) 18 | { 19 | @* Get the starting page *@ 20 | var startNode = Umbraco.Content(startNodeId); 21 | 22 | if (startNode == null) 23 | { 24 |
25 |

There are no posts at this time, try again later.

26 |
27 | 28 | return; 29 | } 30 | 31 | var httpContext = HttpContextAccessor.HttpContext; 32 | 33 | //Gets all blogposts to calculate pages 34 | var blogposts = startNode.Children.OrderBy(x => x.CreateDate).ToList(); 35 | var pageCount = (int)Math.Ceiling((double)blogposts.Count / (double)numberOfMorePosts); 36 | //gets the page from the querystring and sets it to one if it is out of range 37 | var page = 1; 38 | if (httpContext != null && !string.IsNullOrEmpty(httpContext.Request.Query["page"])) 39 | { 40 | int.TryParse(httpContext.Request.Query["page"], out page); 41 | if (page <= 0 || page > pageCount) 42 | { 43 | page = 1; 44 | } 45 | } 46 | //Gets the blogposts for the current page 47 | var pagedBlogposts = blogposts.Skip((page - 1) * numberOfMorePosts).Take(numberOfMorePosts).ToList(); 48 | 49 | if (pagedBlogposts.Count > 0) 50 | { 51 | 67 | } 68 | 69 | if (blogposts.Count > numberOfMorePosts) 70 | { 71 | 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/MacroPartials/Login.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage 2 | 3 | 4 | @using Umbraco.Cms.Web.Common.Models 5 | @using Umbraco.Cms.Web.Common.Security 6 | @using Umbraco.Cms.Web.Website.Controllers 7 | @using Umbraco.Cms.Core.Services 8 | @using Umbraco.Extensions 9 | @inject IMemberExternalLoginProviders memberExternalLoginProviders 10 | @inject ITwoFactorLoginService twoFactorLoginService 11 | @{ 12 | var loginModel = new LoginModel(); 13 | // You can modify this to redirect to a different URL instead of the current one 14 | loginModel.RedirectUrl = null; 15 | } 16 | 17 | 18 | 19 | 20 | 21 | 22 | @if (ViewData.TryGetTwoFactorProviderNames(out var providerNames)) 23 | { 24 | 25 | foreach (var providerName in providerNames) 26 | { 27 |
28 |

Two factor with @providerName.

29 |
30 | @using (Html.BeginUmbracoForm(nameof(UmbTwoFactorLoginController.Verify2FACode))) 31 | { 32 | 33 | 34 | 35 | Input security code:
36 | 37 |
38 |
39 | } 40 |
41 | } 42 | 43 | } 44 | else 45 | { 46 | 47 | 48 | 108 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/MacroPartials/Register.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage 2 | 3 | @using Microsoft.AspNetCore.Http.Extensions 4 | @using Umbraco.Cms.Core 5 | @using Umbraco.Cms.Core.Security 6 | @using Umbraco.Cms.Web.Website.Controllers 7 | @using Umbraco.Cms.Web.Website.Models 8 | @using Umbraco.Docs.Samples.Web.Controllers; 9 | @using Umbraco.Extensions 10 | @inject MemberModelBuilderFactory memberModelBuilderFactory; 11 | 12 | @{ 13 | // Build a registration model with parameters 14 | var registerModel = memberModelBuilderFactory 15 | .CreateRegisterModel() 16 | // Set the member type alias to use for the new member 17 | .WithMemberTypeAlias(Constants.Conventions.MemberTypes.DefaultAlias) 18 | // If null or not set, this will redirect to the current page 19 | .WithRedirectUrl(null) 20 | // Set to true if you want the member editable properties shown. 21 | // It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type. 22 | .WithCustomProperties(false) 23 | .Build(); 24 | 25 | var success = TempData["FormSuccess"] != null; 26 | } 27 | 28 | 29 | 30 | 31 | 32 | @if (success) 33 | { 34 | @* This message will show if registerModel.RedirectUrl is not defined (default) *@ 35 |

Registration succeeded.

36 | } 37 | else 38 | { 39 | using (Html.BeginUmbracoForm( 40 | "HandleRegisterMember", 41 | new { 42 | MemberTypeAlias = registerModel.MemberTypeAlias, 43 | UsernameIsEmail = registerModel.UsernameIsEmail, 44 | RedirectUrl = registerModel.RedirectUrl, 45 | memberGroup = "Professionals" 46 | })) 47 | { 48 |

Create a new account.

49 |
50 |
51 |
52 | 53 | 54 | 55 |
56 |
57 | 58 | 59 | 60 |
61 |
62 | 63 | 64 | 65 |
66 |
67 | 68 | 69 | 70 |
71 | 72 | @if (registerModel.MemberProperties != null) 73 | { 74 | for (var i = 0; i < registerModel.MemberProperties.Count; i++) 75 | { 76 |
77 | @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name) 78 | 79 | @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias) 80 | 81 |
82 | } 83 | } 84 | 85 | 86 | 87 | } 88 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Master.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | // https://our.umbraco.com/documentation/Fundamentals/Design/Stylesheets-Javascript/#bundling--minification-for-javascript-and-css 3 | } 4 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 5 | @using Microsoft.Extensions.Options 6 | @using Umbraco.Cms.Core.Configuration.Models 7 | @inject IOptions hostingSettings 8 | @{ 9 | var debugMode = hostingSettings.Value.Debug; 10 | } 11 | 12 | @using Umbraco.Cms.Core.WebAssets 13 | @inject IRuntimeMinifier runtimeMinifier 14 | 15 | @{ 16 | Layout = null; 17 | // Get basic design settings from the homepage 18 | var home = (Home)Model.Root(); 19 | var font = home.Font; 20 | var colorTheme = home.ColorTheme; 21 | 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @Model.Name - @home.Sitename 31 | 32 | 33 | 34 | 35 | @RenderSection("Header", required: false) 36 | 37 | @{ 38 | // https://our.umbraco.com/documentation/Fundamentals/Design/Stylesheets-Javascript/#bundling--minification-for-javascript-and-css 39 | } 40 | 41 | 42 | 43 | @Html.Raw(await runtimeMinifier.RenderJsHereAsync("registered-js-bundle")) 44 | @Html.Raw(await runtimeMinifier.RenderCssHereAsync("registered-css-bundle")) 45 | 46 | @{ 47 | // The Umbraco RuntimeMinifier CreateJsBundle method doesn't support in view bundle creation like the SmidgeHelper does 48 | 49 | // runtimeMinifier.CreateJsBundle("inline-js-bundle", 50 | // BundlingOptions.NotOptimizedAndComposite, 51 | // new[] { "~/scripts/test-script1.js", "~/scripts/test-script2.js" }); 52 | 53 | // runtimeMinifier.CreateCssBundle("inline-css-bundle", 54 | // BundlingOptions.NotOptimizedAndComposite, 55 | // new[] { "~/css/test-style.css" }); 56 | } 57 | 58 | @{ 59 | //Html.Raw(await runtimeMinifier.RenderJsHereAsync("inline-js-bundle")) 60 | } 61 | @{ 62 | //Html.Raw(await runtimeMinifier.RenderCssHereAsync("inline-css-bundle")) 63 | } 64 | 65 | @{ 66 | // Using SmidgeHelper directly doesn't use the Umbraco Cache Buster 67 | SmidgeHelper 68 | .CreateJsBundle("inline-js-bundle-smidge") 69 | .RequiresJs("~/scripts/test-script1.js", "~/scripts/test-script2.js"); 70 | 71 | SmidgeHelper 72 | .CreateCssBundle("inline-css-bundle-smidge") 73 | .RequiresCss("~/css/test-style.css"); 74 | } 75 | 76 | @await SmidgeHelper.CssHereAsync("inline-css-bundle-smidge", debugMode) 77 | @await SmidgeHelper.JsHereAsync("inline-js-bundle-smidge", debugMode) 78 | 79 | 80 | 81 | 82 | 83 |
84 | 87 |
88 | 89 |
90 | 91 | 103 | 104 | 107 | 108 |
109 |
110 | 111 |
112 |
113 | 114 |
115 | 116 |
117 | @RenderBody() 118 |
119 | 120 |
121 |
122 |
123 |
124 | @home.FooterAddress 125 |
126 |
127 |
128 |
129 | 130 | @* 131 | Wish not to use JQuery? 132 | Insert this method call to load Umbraco Forms client dependencies without JQuery. @Html.RenderUmbracoFormDependencies() 133 | *@ 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/CategoryLinks.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | @foreach (var category in Model) 3 | { 4 | 5 | @category 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/ContactForm.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @using Umbraco.SampleSite 3 | @model Umbraco.SampleSite.ContactFormViewModel 4 | 5 | @{ 6 | var message = TempData["Message"]?.ToString(); 7 | } 8 |
9 | @using (Html.BeginUmbracoForm(nameof(ContactFormController.Submit))) 10 | { 11 |
12 | @Html.TextBoxFor(m => m.Name, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Name)}) 13 | @Html.ValidationMessageFor(m => m.Name) 14 |
15 |
16 | @Html.TextBoxFor(m => m.Email, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Email)}) 17 | @Html.ValidationMessageFor(m => m.Email) 18 |
19 |
20 | @Html.TextAreaFor(m => m.Message, new {@class="form-control", placeholder = Html.DisplayNameFor(m => m.Message)}) 21 | @Html.ValidationMessageFor(m => m.Message) 22 |
23 | 24 | @if (!string.IsNullOrEmpty(message)) 25 | { 26 | @message 27 | } 28 | } 29 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/Fundamentals/Backoffice/Built-in-Property-Editors/Image-Cropper.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Cms.Core.Models 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 3 |

/Fundamentals/Backoffice/Property-Editors/Built-in-Property-Editors/Image-Cropper/

4 | 5 | 6 |
7 |
8 |
9 |
10 |
11 | 12 |
13 |
14 | 15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | @if (Model.SecondaryPhoto != null) 26 | { 27 | 28 | } 29 |
30 |
31 | 32 |
33 |
34 |
35 | 36 | 37 |
38 |
39 |
40 |
41 |
42 | @if (Model.Photo is not null) 43 | { 44 | @Model.Photo.Name 45 | } 46 |
47 |
48 |
49 |
50 |
51 | 52 |
53 |
54 |
55 |
56 |
57 | @if (Model.Photo is not null) 58 | { 59 | var cropUrl = Url.GetCropUrl(Model.Photo, "square", false); 60 | 67 |
68 | } 69 |
70 |
71 |
72 |
73 |
74 | 75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |
83 |
84 |
85 |
86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/Fundamentals/Design/Rendering-Media.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 |
3 |
4 |
5 | 6 |

/Fundamentals/Design/Rendering-Media/

7 | 8 |

Example 1: Accessing a Media Image IPublishedContent item based upon its Id

9 | @{ 10 | // The Umbraco Helper has a Media method that will retrieve a Media Item by Guid in the form of IPublishedContent, in this example the Media Item has a Guid of 55240594-b265-4fc2-b1c1-feffc5cf9571 11 | 12 | var mediaItem = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571")); 13 | 14 | if (mediaItem != null) 15 | { 16 | // To get the url for your media item, you use the Url method: 17 | var url = mediaItem.Url(); 18 | // to read a property by alias 19 | var imageHeight = mediaItem.Value("umbracoHeight"); 20 | var imageWidth = mediaItem.Value("umbracoWidth"); 21 | var orientationCssClass = imageWidth > imageHeight ? "img-landscape" : "img-portrait"; 22 | 23 | @mediaItem.Name 24 | } 25 | } 26 | 27 |

28 | Example 2: Accessing a Media Image Modelsbuilder item based upon its Id 29 |

30 | 31 | @{ 32 | // Since the Image Model generated by Modelsbuilder is a compatible type to IPublishedContent we can use the 'as' operator to convert into the ModelsBuilder Umbraco.Cms.Web.Common.PublishedModels.Image class 33 | var mediaItemAsImage = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571")) as Image; 34 | if (mediaItemAsImage != null) 35 | { 36 | // you could add this as an extension method to the Umbraco.Cms.Web.Common.PublishedModels.Image class 37 | var orientationCssClass = mediaItemAsImage.UmbracoWidth > mediaItemAsImage.UmbracoHeight ? "img-landscape" : "img-portrait"; 38 | 39 | @mediaItemAsImage.Name 40 | } 41 | } 42 | 43 |

Example of using Image Cropper

44 | 45 | @{ 46 | var mediaItemToCrop = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571")); 47 | if (mediaItemToCrop != null) 48 | { 49 | @mediaItemToCrop.Name 50 | } 51 | } 52 | 53 |
54 |
55 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/LoginStatus.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | 3 | @using Microsoft.AspNetCore.Http.Extensions 4 | @using Umbraco.Cms.Web.Common.Models 5 | @using Umbraco.Cms.Web.Website.Controllers 6 | @using Umbraco.Extensions 7 | 8 | @{ 9 | var isLoggedIn = Context.User?.Identity?.IsAuthenticated ?? false; 10 | var logoutModel = new PostRedirectModel(); 11 | // You can modify this to redirect to a different URL instead of the current one 12 | logoutModel.RedirectUrl = null; 13 | } 14 | 15 | @if (isLoggedIn) 16 | { 17 | 27 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/Navigation/SubNavigation.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @using Umbraco.Cms.Core.Models.PublishedContent 3 | @using Umbraco.Cms.Core.Routing 4 | @using Umbraco.Extensions 5 | 6 | @inject IPublishedValueFallback PublishedValueFallback 7 | @inject IPublishedUrlProvider PublishedUrlProvider 8 | @{ 9 | var siteSection = Model.AncestorOrSelf(2); 10 | var selection = siteSection.Children.Where(x => x.IsVisible(PublishedValueFallback)); 11 | } 12 | 13 | @foreach (var item in selection) 14 | { 15 | @item.Name 16 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/Navigation/TopNavigation.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Cms.Core.Models.PublishedContent 2 | @using Umbraco.Cms.Core.Routing 3 | @using Umbraco.Extensions 4 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 5 | @{ 6 | var site = Model.Root(); 7 | var selection = site.Children.Where(x => x.IsVisible()); 8 | } 9 | 10 | @site.Name 11 | 12 | @foreach (var item in selection) 13 | { 14 | @item.Name 15 | } 16 | 17 | @Html.Partial("LoginStatus") -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/SectionHeader.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 |
3 |
4 |

@Model.Value("PageTitle")

5 |
6 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/area.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 3 | 4 |
9 | @await Html.GetBlockGridItemsHtmlAsync(Model) 10 |
11 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/areas.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 3 | @{ 4 | if (Model?.Areas.Any() != true) { return; } 5 | } 6 | 7 |
9 | @foreach (var area in Model.Areas) 10 | { 11 | @await Html.GetBlockGridItemAreaHtmlAsync(area) 12 | } 13 |
14 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/default.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 3 | @{ 4 | if (Model?.Any() != true) { return; } 5 | } 6 | 7 |
10 | @await Html.GetBlockGridItemsHtmlAsync(Model) 11 |
12 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/blockgrid/items.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Cms.Core.Models.Blocks 2 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage> 3 | @{ 4 | if (Model?.Any() != true) { return; } 5 | } 6 | 7 |
8 | @foreach (var item in Model) 9 | { 10 | 11 |
19 | @{ 20 | var partialViewName = "blockgrid/Components/" + item.Content.ContentType.Alias; 21 | try 22 | { 23 | @await Html.PartialAsync(partialViewName, item) 24 | } 25 | catch (InvalidOperationException) 26 | { 27 |

28 | Could not render component of type: @(item.Content.ContentType.Alias) 29 |
30 | This likely happened because the partial view @partialViewName could not be found. 31 |

32 | } 33 | } 34 |
35 | } 36 |
37 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/blocklist/default.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @{ 3 | if (Model?.Any() != true) { return; } 4 | } 5 |
6 | @foreach (var block in Model) 7 | { 8 | if (block?.ContentUdi == null) { continue; } 9 | var data = block.Content; 10 | 11 | @await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block) 12 | } 13 |
14 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/bootstrap3-fluid.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web 2 | @using Microsoft.AspNetCore.Html 3 | @using Newtonsoft.Json.Linq 4 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 5 | 6 | @* 7 | Razor helpers located at the bottom of this file 8 | *@ 9 | 10 | @if (Model is JObject && Model?.sections is not null) 11 | { 12 | var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; 13 | 14 |
15 | @if (oneColumn) 16 | { 17 | foreach (var section in Model.sections) 18 | { 19 |
20 | @foreach (var row in section.rows) 21 | { 22 | renderRow(row); 23 | } 24 |
25 | } 26 | } 27 | else 28 | { 29 |
30 | @foreach (var sec in Model.sections) 31 | { 32 |
33 |
34 | @foreach (var row in sec.rows) 35 | { 36 | renderRow(row); 37 | } 38 |
39 |
40 | } 41 |
42 | } 43 |
44 | } 45 | 46 | @functions{ 47 | 48 | private async Task renderRow(dynamic row) 49 | { 50 |
51 |
52 | @foreach (var area in row.areas) 53 | { 54 |
55 |
56 | @foreach (var control in area.controls) 57 | { 58 | if (control?.editor?.view != null) 59 | { 60 | @await Html.PartialAsync("grid/editors/base", (object)control) 61 | } 62 | } 63 |
64 |
65 | } 66 |
67 |
68 | } 69 | } 70 | 71 | @functions{ 72 | 73 | public static HtmlString RenderElementAttributes(dynamic contentItem) 74 | { 75 | var attrs = new List(); 76 | JObject cfg = contentItem.config; 77 | 78 | if (cfg != null) 79 | { 80 | foreach (JProperty property in cfg.Properties()) 81 | { 82 | var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); 83 | attrs.Add(property.Name + "=\"" + propertyValue + "\""); 84 | } 85 | } 86 | 87 | JObject style = contentItem.styles; 88 | 89 | if (style != null) { 90 | var cssVals = new List(); 91 | foreach (JProperty property in style.Properties()) 92 | { 93 | var propertyValue = property.Value.ToString(); 94 | if (string.IsNullOrWhiteSpace(propertyValue) == false) 95 | { 96 | cssVals.Add(property.Name + ":" + propertyValue + ";"); 97 | } 98 | } 99 | 100 | if (cssVals.Any()) 101 | attrs.Add("style='" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "'"); 102 | } 103 | 104 | return new HtmlString(string.Join(" ", attrs)); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/bootstrap3.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web 2 | @using Microsoft.AspNetCore.Html 3 | @using Newtonsoft.Json.Linq 4 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 5 | 6 | @if (Model is JObject && Model?.sections is not null) 7 | { 8 | var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; 9 | 10 |
11 | @if (oneColumn) 12 | { 13 | foreach (var section in Model.sections) 14 | { 15 |
16 | @foreach (var row in section.rows) 17 | { 18 | renderRow(row, true); 19 | } 20 |
21 | } 22 | } 23 | else 24 | { 25 |
26 |
27 | @foreach (var sec in Model.sections) 28 | { 29 |
30 |
31 | @foreach (var row in sec.rows) 32 | { 33 | renderRow(row, false); 34 | } 35 |
36 |
37 | } 38 |
39 |
40 | } 41 |
42 | } 43 | 44 | @functions{ 45 | 46 | private async Task renderRow(dynamic row, bool singleColumn) 47 | { 48 |
49 | @if (singleColumn) { 50 | @:
51 | } 52 |
53 | @foreach (var area in row.areas) 54 | { 55 |
56 |
57 | @foreach (var control in area.controls) 58 | { 59 | if (control?.editor?.view != null) 60 | { 61 | @await Html.PartialAsync("grid/editors/base", (object)control) 62 | } 63 | } 64 |
65 |
66 | } 67 |
68 | @if (singleColumn) { 69 | @:
70 | } 71 |
72 | } 73 | 74 | } 75 | 76 | @functions{ 77 | 78 | public static HtmlString RenderElementAttributes(dynamic contentItem) 79 | { 80 | var attrs = new List(); 81 | JObject cfg = contentItem.config; 82 | 83 | if (cfg != null) 84 | { 85 | foreach (JProperty property in cfg.Properties()) 86 | { 87 | var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); 88 | attrs.Add(property.Name + "=\"" + propertyValue + "\""); 89 | } 90 | } 91 | 92 | JObject style = contentItem.styles; 93 | 94 | if (style != null) 95 | { 96 | var cssVals = new List(); 97 | foreach (JProperty property in style.Properties()) 98 | { 99 | var propertyValue = property.Value.ToString(); 100 | if (string.IsNullOrWhiteSpace(propertyValue) == false) 101 | { 102 | cssVals.Add(property.Name + ":" + propertyValue + ";"); 103 | } 104 | } 105 | 106 | if (cssVals.Any()) 107 | attrs.Add("style=\"" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "\""); 108 | } 109 | 110 | return new HtmlString(string.Join(" ", attrs)); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/base.cshtml: -------------------------------------------------------------------------------- 1 | @model dynamic 2 | 3 | @try 4 | { 5 | string editor = EditorView(Model); 6 | @await Html.PartialAsync(editor, Model as object) 7 | } 8 | catch (Exception ex) 9 | { 10 |
@ex.ToString()
11 | } 12 | 13 | @functions{ 14 | 15 | public static string EditorView(dynamic contentItem) 16 | { 17 | string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); 18 | view = view.Replace(".html", ".cshtml"); 19 | 20 | if (!view.Contains("/")) 21 | { 22 | view = "grid/editors/" + view; 23 | } 24 | 25 | return view; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/embed.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | 3 | @if (Model is not null) 4 | { 5 | string embedValue = Convert.ToString(Model.value); 6 | embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; 7 | 8 |
9 | @Html.Raw(embedValue) 10 |
11 | } 12 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/macro.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | 3 | @if (Model?.value is not null) 4 | { 5 | string macroAlias = Model.value.macroAlias.ToString(); 6 | var parameters = new Dictionary(); 7 | foreach (var mpd in Model.value.macroParamsDictionary) 8 | { 9 | parameters.Add(mpd.Name, mpd.Value); 10 | } 11 | 12 | 13 | @await Umbraco.RenderMacroAsync(macroAlias, parameters) 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/media.cshtml: -------------------------------------------------------------------------------- 1 | @model dynamic 2 | @using Umbraco.Cms.Core.Media 3 | @using Umbraco.Cms.Core.PropertyEditors.ValueConverters 4 | @inject IImageUrlGenerator ImageUrlGenerator 5 | 6 | @if (Model?.value is not null) 7 | { 8 | var url = Model.value.image; 9 | 10 | if (Model.editor.config != null && Model.editor.config.size != null) 11 | { 12 | if (Model.value.coordinates != null) 13 | { 14 | url = ImageCropperTemplateCoreExtensions.GetCropUrl( 15 | (string)url, 16 | ImageUrlGenerator, 17 | width: (int)Model.editor.config.size.width, 18 | height: (int)Model.editor.config.size.height, 19 | cropAlias: "default", 20 | cropDataSet: new ImageCropperValue 21 | { 22 | Crops = new[] 23 | { 24 | new ImageCropperValue.ImageCropperCrop 25 | { 26 | Alias = "default", 27 | Coordinates = new ImageCropperValue.ImageCropperCropCoordinates 28 | { 29 | X1 = (decimal)Model.value.coordinates.x1, 30 | Y1 = (decimal)Model.value.coordinates.y1, 31 | X2 = (decimal)Model.value.coordinates.x2, 32 | Y2 = (decimal)Model.value.coordinates.y2 33 | } 34 | } 35 | } 36 | }); 37 | } 38 | else 39 | { 40 | url = ImageCropperTemplateCoreExtensions.GetCropUrl( 41 | (string)url, 42 | ImageUrlGenerator, 43 | width: (int)Model.editor.config.size.width, 44 | height: (int)Model.editor.config.size.height, 45 | cropDataSet: new ImageCropperValue 46 | { 47 | FocalPoint = new ImageCropperValue.ImageCropperFocalPoint 48 | { 49 | Top = Model.value.focalPoint == null ? 0.5m : Model.value.focalPoint.top, 50 | Left = Model.value.focalPoint == null ? 0.5m : Model.value.focalPoint.left 51 | } 52 | }); 53 | } 54 | } 55 | 56 | var altText = Model.value.altText ?? Model.value.caption ?? string.Empty; 57 | 58 | @altText 59 | 60 | if (Model.value.caption != null) 61 | { 62 |

@Model.value.caption

63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/rte.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Cms.Core.Templates 2 | @model dynamic 3 | @inject HtmlLocalLinkParser HtmlLocalLinkParser; 4 | @inject HtmlUrlParser HtmlUrlParser; 5 | @inject HtmlImageSourceParser HtmlImageSourceParser; 6 | 7 | @{ 8 | var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString()); 9 | value = HtmlUrlParser.EnsureUrls(value); 10 | value = HtmlImageSourceParser.EnsureImageSources(value); 11 | } 12 | 13 | @Html.Raw(value) 14 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Partials/grid/editors/textstring.cshtml: -------------------------------------------------------------------------------- 1 | @model dynamic 2 | 3 | @if (Model?.editor.config.markup is not null) 4 | { 5 | string markup = Model.editor.config.markup.ToString(); 6 | markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString()); 7 | 8 | if (Model.editor.config.style != null) 9 | { 10 | markup = markup.Replace("#style#", Model.editor.config.style.ToString()); 11 | } 12 | 13 | 14 | @Html.Raw(markup) 15 | 16 | } 17 | else 18 | { 19 | 20 |
@Model?.value
21 |
22 | } 23 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/People.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Web 2 | @using Microsoft.AspNetCore.Html 3 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 4 | @{ 5 | Layout = "Master.cshtml"; 6 | } 7 | @{ 8 | void SocialLink(string content, string service) 9 | { 10 | if (string.IsNullOrEmpty(content)) 11 | { 12 | return; 13 | } 14 | 15 | ; //semicolon needed otherwise cannot be resolved 16 | @service 17 | } 18 | } 19 | 20 | @await Html.PartialAsync("~/Views/Partials/SectionHeader.cshtml") 21 | 22 |
23 | 24 |
25 | 26 | 35 |
36 | @foreach (Person person in Model.Children()) 37 | { 38 | 39 |
40 | @{ 41 | var imageUrl = Url.GetCropUrl(person.Photo, 323, 300, htmlEncode: false).ToString(); 42 | } 43 |
44 | @*
*@ 45 | 46 |
47 |

@person.Name

48 | @if (!string.IsNullOrEmpty(person.Email)) 49 | { 50 | 51 | } 52 |
53 | @{ SocialLink(person.FacebookUsername, "Facebook"); } 54 | @{ SocialLink(person.TwitterUsername, "Twitter"); } 55 | @{ SocialLink(person.LinkedInUsername, "LinkedIn"); } 56 | @{ SocialLink(person.InstagramUsername, "Instagram"); } 57 |
58 |
59 |
60 | } 61 |
62 |
63 | 64 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Person.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @{ 3 | Layout = "Master.cshtml"; 4 | } 5 | 6 | @await Html.PartialAsync("~/Views/Partials/SectionHeader.cshtml") 7 | 8 |
9 | Our API says @Model.Content.Name has brown hair: @Model.IsYes?
10 | 11 |
12 | 13 | @await Html.PartialAsync("~/Views/Partials/Fundamentals/Backoffice/Built-in-Property-Editors/Image-Cropper.cshtml") 14 | 15 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Product.cshtml: -------------------------------------------------------------------------------- 1 | @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage 2 | @{ 3 | Layout = "Master.cshtml"; 4 | var defaultCurrency = Model.Parent().DefaultCurrency; 5 | } 6 | 7 | @Html.Partial("~/Views/Partials/SectionHeader.cshtml", Model.Parent) 8 | 9 |
10 |
11 |
12 |
13 |
14 | @Model.ProductName image 15 |
16 |
17 |
18 |

@Model.ProductName

19 |
@defaultCurrency @Model.Price.ToString("F")
20 |
@Model.Description
21 |
22 | 23 |
24 |
25 | @if (Model.Features != null) 26 | { 27 | foreach (var feature in Model.Features) 28 | { 29 |
30 |

@feature.FeatureName

31 |
@feature.FeatureDetails
32 |
33 | } 34 | } 35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | 43 | @Html.GetGridHtml(Model, "bodyText", "bootstrap3-fluid") 44 |
45 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/Shared/Components/ProductView/Default.cshtml: -------------------------------------------------------------------------------- 1 | 

Welcome to your Home Page

2 | 3 |

Products List

4 | 5 |
    6 | @foreach (var product in Model) 7 | { 8 |
  • @product
  • 9 | } 10 |
-------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @using Umbraco.Docs.Samples.Web 3 | @using Umbraco.Cms.Web.Common.PublishedModels 4 | @using Umbraco.Cms.Web.Common.Views 5 | @using Umbraco.Cms.Core 6 | 7 | @inject Smidge.SmidgeHelper SmidgeHelper 8 | 9 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 10 | @addTagHelper *, Smidge 11 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema" : "./umbraco/config/appsettings-schema.json", 3 | "Serilog": { 4 | "MinimumLevel": { 5 | "Default": "Information" 6 | }, 7 | "WriteTo": [ 8 | { 9 | "Name": "Async", 10 | "Args": { 11 | "configure": [ 12 | { 13 | "Name": "Console" 14 | } 15 | ] 16 | } 17 | } 18 | ] 19 | }, 20 | "Umbraco": { 21 | "CMS": { 22 | "Content": { 23 | "MacroErrors": "Throw" 24 | }, 25 | "Global": { 26 | "Smtp": { 27 | "From": "your@email.here", 28 | "Host": "localhost", 29 | "Port": 25 30 | } 31 | }, 32 | "Hosting": { 33 | "Debug": true 34 | }, 35 | "RuntimeMinification": { 36 | "useInMemoryCache": true, 37 | "cacheBuster": "Timestamp" 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./appsettings-schema.json", 3 | "Serilog": { 4 | "MinimumLevel": { 5 | "Default": "Information", 6 | "Override": { 7 | "Microsoft": "Warning", 8 | "Microsoft.Hosting.Lifetime": "Information", 9 | "System": "Warning" 10 | } 11 | } 12 | }, 13 | "ConnectionStrings": { 14 | "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True", 15 | "umbracoDbDSN_ProviderName": "Microsoft.Data.SQLite" 16 | }, 17 | "Umbraco": { 18 | "CMS": { 19 | "Hosting": { 20 | "Debug": true 21 | }, 22 | "Global": { 23 | "Id": "524ab247-0239-41e3-93c4-b6a9445cbbf7" 24 | }, 25 | "ModelsBuilder": { 26 | "ModelsMode": "SourceCodeAuto" 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/Data/Umbraco.sqlite.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/umbraco/Data/Umbraco.sqlite.db -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/ContentBase.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | // Mixin Content Type with alias "contentBase" 22 | /// Content Base 23 | public partial interface IContentBase : IPublishedContent 24 | { 25 | /// Content 26 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 27 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 28 | global::Newtonsoft.Json.Linq.JToken BodyText { get; } 29 | 30 | /// Page Title 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | string PageTitle { get; } 34 | } 35 | 36 | /// Content Base 37 | [PublishedModel("contentBase")] 38 | public partial class ContentBase : PublishedContentModel, IContentBase 39 | { 40 | // helpers 41 | #pragma warning disable 0109 // new is redundant 42 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 43 | public new const string ModelTypeAlias = "contentBase"; 44 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 45 | public new const PublishedItemType ModelItemType = PublishedItemType.Content; 46 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 47 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 48 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 49 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 50 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 51 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 52 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 53 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 54 | #pragma warning restore 0109 55 | 56 | private IPublishedValueFallback _publishedValueFallback; 57 | 58 | // ctor 59 | public ContentBase(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 60 | : base(content, publishedValueFallback) 61 | { 62 | _publishedValueFallback = publishedValueFallback; 63 | } 64 | 65 | // properties 66 | 67 | /// 68 | /// Content 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("bodyText")] 73 | public virtual global::Newtonsoft.Json.Linq.JToken BodyText => GetBodyText(this, _publishedValueFallback); 74 | 75 | /// Static getter for Content 76 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 77 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 78 | public static global::Newtonsoft.Json.Linq.JToken GetBodyText(IContentBase that, IPublishedValueFallback publishedValueFallback) => that.Value(publishedValueFallback, "bodyText"); 79 | 80 | /// 81 | /// Page Title: The title of the page, this is also the first text in a google search result. The ideal length is between 40 and 60 characters 82 | /// 83 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 84 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 85 | [ImplementPropertyType("pageTitle")] 86 | public virtual string PageTitle => GetPageTitle(this, _publishedValueFallback); 87 | 88 | /// Static getter for Page Title 89 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 90 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 91 | public static string GetPageTitle(IContentBase that, IPublishedValueFallback publishedValueFallback) => that.Value(publishedValueFallback, "pageTitle"); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/ContentPage.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Content Page 22 | [PublishedModel("contentPage")] 23 | public partial class ContentPage : PublishedContentModel, IContentBase, INavigationBase 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "contentPage"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Content; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public ContentPage(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Header Image 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 57 | [ImplementPropertyType("headerImage")] 58 | public virtual global::Umbraco.Cms.Core.Models.MediaWithCrops HeaderImage => this.Value(_publishedValueFallback, "headerImage"); 59 | 60 | /// 61 | /// Content 62 | /// 63 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 64 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 65 | [ImplementPropertyType("bodyText")] 66 | public virtual global::Newtonsoft.Json.Linq.JToken BodyText => global::Umbraco.Cms.Web.Common.PublishedModels.ContentBase.GetBodyText(this, _publishedValueFallback); 67 | 68 | /// 69 | /// Page Title: The title of the page, this is also the first text in a google search result. The ideal length is between 40 and 60 characters 70 | /// 71 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 72 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 73 | [ImplementPropertyType("pageTitle")] 74 | public virtual string PageTitle => global::Umbraco.Cms.Web.Common.PublishedModels.ContentBase.GetPageTitle(this, _publishedValueFallback); 75 | 76 | /// 77 | /// Keywords: Keywords that describe the content of the page. This is considered optional since most modern search engines don't use this anymore 78 | /// 79 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 80 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 81 | [ImplementPropertyType("keywords")] 82 | public virtual global::System.Collections.Generic.IEnumerable Keywords => global::Umbraco.Cms.Web.Common.PublishedModels.NavigationBase.GetKeywords(this, _publishedValueFallback); 83 | 84 | /// 85 | /// Description: A brief description of the content on your page. This text is shown below the title in a google search result and also used for Social Sharing Cards. The ideal length is between 130 and 155 characters 86 | /// 87 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 88 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 89 | [ImplementPropertyType("seoMetaDescription")] 90 | public virtual string SeoMetaDescription => global::Umbraco.Cms.Web.Common.PublishedModels.NavigationBase.GetSeoMetaDescription(this, _publishedValueFallback); 91 | 92 | /// 93 | /// Hide in Navigation: If you don't want this page to appear in the navigation, check this box 94 | /// 95 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 96 | [ImplementPropertyType("umbracoNavihide")] 97 | public virtual bool UmbracoNavihide => global::Umbraco.Cms.Web.Common.PublishedModels.NavigationBase.GetUmbracoNavihide(this, _publishedValueFallback); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/CustomImage.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Custom Image 22 | [PublishedModel("customImage")] 23 | public partial class CustomImage : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "customImage"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public CustomImage(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// CustomCropper 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 57 | [ImplementPropertyType("customCropper")] 58 | public virtual global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ImageCropperValue CustomCropper => this.Value(_publishedValueFallback, "customCropper"); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/Feature.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Feature 22 | [PublishedModel("feature")] 23 | public partial class Feature : PublishedElementModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "feature"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Content; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public Feature(IPublishedElement content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Details 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 57 | [ImplementPropertyType("featureDetails")] 58 | public virtual string FeatureDetails => this.Value(_publishedValueFallback, "featureDetails"); 59 | 60 | /// 61 | /// Name 62 | /// 63 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 64 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 65 | [ImplementPropertyType("featureName")] 66 | public virtual string FeatureName => this.Value(_publishedValueFallback, "featureName"); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/File.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// File 22 | [PublishedModel("File")] 23 | public partial class File : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "File"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public File(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// File 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/Folder.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Folder 22 | [PublishedModel("Folder")] 23 | public partial class Folder : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "Folder"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public Folder(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/Image.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Image 22 | [PublishedModel("Image")] 23 | public partial class Image : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "Image"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public Image(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// Image 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ImageCropperValue UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | 75 | /// 76 | /// Height: in pixels 77 | /// 78 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 79 | [ImplementPropertyType("umbracoHeight")] 80 | public virtual int UmbracoHeight => this.Value(_publishedValueFallback, "umbracoHeight"); 81 | 82 | /// 83 | /// Width: in pixels 84 | /// 85 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 86 | [ImplementPropertyType("umbracoWidth")] 87 | public virtual int UmbracoWidth => this.Value(_publishedValueFallback, "umbracoWidth"); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/Member.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Member 22 | [PublishedModel("Member")] 23 | public partial class Member : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "Member"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Member; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public Member(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Is Approved 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoMemberApproved")] 57 | public virtual bool UmbracoMemberApproved => this.Value(_publishedValueFallback, "umbracoMemberApproved"); 58 | 59 | /// 60 | /// Comments 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoMemberComments")] 65 | public virtual string UmbracoMemberComments => this.Value(_publishedValueFallback, "umbracoMemberComments"); 66 | 67 | /// 68 | /// Failed Password Attempts 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [ImplementPropertyType("umbracoMemberFailedPasswordAttempts")] 72 | public virtual int UmbracoMemberFailedPasswordAttempts => this.Value(_publishedValueFallback, "umbracoMemberFailedPasswordAttempts"); 73 | 74 | /// 75 | /// Last Lockout Date 76 | /// 77 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 78 | [ImplementPropertyType("umbracoMemberLastLockoutDate")] 79 | public virtual global::System.DateTime UmbracoMemberLastLockoutDate => this.Value(_publishedValueFallback, "umbracoMemberLastLockoutDate"); 80 | 81 | /// 82 | /// Last Login Date 83 | /// 84 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 85 | [ImplementPropertyType("umbracoMemberLastLogin")] 86 | public virtual global::System.DateTime UmbracoMemberLastLogin => this.Value(_publishedValueFallback, "umbracoMemberLastLogin"); 87 | 88 | /// 89 | /// Last Password Change Date 90 | /// 91 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 92 | [ImplementPropertyType("umbracoMemberLastPasswordChangeDate")] 93 | public virtual global::System.DateTime UmbracoMemberLastPasswordChangeDate => this.Value(_publishedValueFallback, "umbracoMemberLastPasswordChangeDate"); 94 | 95 | /// 96 | /// Is Locked Out 97 | /// 98 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 99 | [ImplementPropertyType("umbracoMemberLockedOut")] 100 | public virtual bool UmbracoMemberLockedOut => this.Value(_publishedValueFallback, "umbracoMemberLockedOut"); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/UmbracoMediaArticle.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Article 22 | [PublishedModel("umbracoMediaArticle")] 23 | public partial class UmbracoMediaArticle : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "umbracoMediaArticle"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public UmbracoMediaArticle(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// Article 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/UmbracoMediaAudio.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Audio 22 | [PublishedModel("umbracoMediaAudio")] 23 | public partial class UmbracoMediaAudio : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "umbracoMediaAudio"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public UmbracoMediaAudio(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// Audio 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/UmbracoMediaVectorGraphics.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Vector Graphics (SVG) 22 | [PublishedModel("umbracoMediaVectorGraphics")] 23 | public partial class UmbracoMediaVectorGraphics : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "umbracoMediaVectorGraphics"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public UmbracoMediaVectorGraphics(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// Vector Graphics 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/umbraco/models/UmbracoMediaVideo.generated.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Umbraco.ModelsBuilder.Embedded v10.0.0-rc4+9ff06ee 6 | // 7 | // Changes to this file will be lost if the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Linq.Expressions; 13 | using Umbraco.Cms.Core.Models.PublishedContent; 14 | using Umbraco.Cms.Core.PublishedCache; 15 | using Umbraco.Cms.Infrastructure.ModelsBuilder; 16 | using Umbraco.Cms.Core; 17 | using Umbraco.Extensions; 18 | 19 | namespace Umbraco.Cms.Web.Common.PublishedModels 20 | { 21 | /// Video 22 | [PublishedModel("umbracoMediaVideo")] 23 | public partial class UmbracoMediaVideo : PublishedContentModel 24 | { 25 | // helpers 26 | #pragma warning disable 0109 // new is redundant 27 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 28 | public new const string ModelTypeAlias = "umbracoMediaVideo"; 29 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 30 | public new const PublishedItemType ModelItemType = PublishedItemType.Media; 31 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 32 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 33 | public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor) 34 | => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias); 35 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 36 | [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] 37 | public static IPublishedPropertyType GetModelPropertyType(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression> selector) 38 | => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector); 39 | #pragma warning restore 0109 40 | 41 | private IPublishedValueFallback _publishedValueFallback; 42 | 43 | // ctor 44 | public UmbracoMediaVideo(IPublishedContent content, IPublishedValueFallback publishedValueFallback) 45 | : base(content, publishedValueFallback) 46 | { 47 | _publishedValueFallback = publishedValueFallback; 48 | } 49 | 50 | // properties 51 | 52 | /// 53 | /// Size: in bytes 54 | /// 55 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 56 | [ImplementPropertyType("umbracoBytes")] 57 | public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); 58 | 59 | /// 60 | /// Type 61 | /// 62 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 63 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 64 | [ImplementPropertyType("umbracoExtension")] 65 | public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); 66 | 67 | /// 68 | /// Video 69 | /// 70 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "10.0.0-rc4+9ff06ee")] 71 | [global::System.Diagnostics.CodeAnalysis.MaybeNull] 72 | [ImplementPropertyType("umbracoFile")] 73 | public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/css/test-style.css: -------------------------------------------------------------------------------- 1 | h1{ 2 | color:aquamarine; 3 | } -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/images/unicorn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/images/unicorn.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/0aslars0/7377957524_347859faac_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/0aslars0/7377957524_347859faac_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/17552d12081d4d01b68132c495d6576f/7373036290_5e8420bf36_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/17552d12081d4d01b68132c495d6576f/7373036290_5e8420bf36_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/1bc5280b8658402789d958e2576e469b/14272036539_469ca21d5c_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/1bc5280b8658402789d958e2576e469b/14272036539_469ca21d5c_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/1c3833ce637f4985a142e029d1d50cac/18720470241_ff77768544_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/1c3833ce637f4985a142e029d1d50cac/18720470241_ff77768544_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/1d0b713a022a49c8b842a2463c83a553/7373036208_30257976a0_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/1d0b713a022a49c8b842a2463c83a553/7373036208_30257976a0_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/1k2bvtyp/jan-skovgaard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/1k2bvtyp/jan-skovgaard.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/20e3a8ffad1b4fe9b48cb8461c46d2d0/7371127652_e01b6ab56f_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/20e3a8ffad1b4fe9b48cb8461c46d2d0/7371127652_e01b6ab56f_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/34371d0892c84015912ebaacd002c5d0/18530280048_459b8b61b2_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/34371d0892c84015912ebaacd002c5d0/18530280048_459b8b61b2_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/3a8c3d0bd46b4c25907a6479354ac65d/16403439029_f500be349b_o.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/3a8c3d0bd46b4c25907a6479354ac65d/16403439029_f500be349b_o.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/46a025d6095a4b148b961b59ca4e951c/7377957524_347859faac_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/46a025d6095a4b148b961b59ca4e951c/7377957524_347859faac_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/4c4e24ba8b1d44b6903412be100001fb/18095416144_44a566a5f4_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/4c4e24ba8b1d44b6903412be100001fb/18095416144_44a566a5f4_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/55514845b8bd487cb3709724852fd6bb/4730684907_8a7f8759cb_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/55514845b8bd487cb3709724852fd6bb/4730684907_8a7f8759cb_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/5guogia1/7371127652_e01b6ab56f_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/5guogia1/7371127652_e01b6ab56f_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/5u3kkwsd/damiaan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/5u3kkwsd/damiaan.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/662af6ca411a4c93a6c722c4845698e7/16403439029_f500be349b_o.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/662af6ca411a4c93a6c722c4845698e7/16403439029_f500be349b_o.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/732e8047f76342e09974ea886dfe05c0/18095416144_44a566a5f4_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/732e8047f76342e09974ea886dfe05c0/18095416144_44a566a5f4_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/79a350528c974a118948172f027f1273/18720470241_ff77768544_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/79a350528c974a118948172f027f1273/18720470241_ff77768544_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/abchlerf/poornima_nayar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/abchlerf/poornima_nayar.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/amoot1xi/matt-brailsford.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/amoot1xi/matt-brailsford.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/b73f6c8a3e8e437fb4f7d5642a76ac43/18530280048_459b8b61b2_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/b73f6c8a3e8e437fb4f7d5642a76ac43/18530280048_459b8b61b2_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/b76ddb4ee603401499066087984740ec/5852022091_87c5d045ab_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/b76ddb4ee603401499066087984740ec/5852022091_87c5d045ab_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/bm5hn4xl/lee-kelleher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/bm5hn4xl/lee-kelleher.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/buumkg0y/14272036539_469ca21d5c_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/buumkg0y/14272036539_469ca21d5c_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/c0969cab13ab4de9819a848619ac2b5d/18095416144_44a566a5f4_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/c0969cab13ab4de9819a848619ac2b5d/18095416144_44a566a5f4_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/c09ec77f08e3466aac58c979befd3cd6/5852022211_9028df67c0_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/c09ec77f08e3466aac58c979befd3cd6/5852022211_9028df67c0_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/c4784c9fc99a4a5ab7e2224cf16dd354/18095416144_44a566a5f4_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/c4784c9fc99a4a5ab7e2224cf16dd354/18095416144_44a566a5f4_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/cf1ab8dcad0f4a8e974b87b84777b0d6/18720470241_ff77768544_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/cf1ab8dcad0f4a8e974b87b84777b0d6/18720470241_ff77768544_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/cqwfkfy3/7373036290_5e8420bf36_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/cqwfkfy3/7373036290_5e8420bf36_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/doxkuvnu/ravi-motha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/doxkuvnu/ravi-motha.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/dsypff0x/laura_weatherhead.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/dsypff0x/laura_weatherhead.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/eee91c05b2e84031a056dcd7f28eff89/18531852339_981b067419_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/eee91c05b2e84031a056dcd7f28eff89/18531852339_981b067419_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/ef1lf1dc/marc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/ef1lf1dc/marc.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/fa763e0d0ceb408c8720365d57e06e32/18531854019_351c579559_h.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/fa763e0d0ceb408c8720365d57e06e32/18531854019_351c579559_h.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/fzobwfow/janae_cram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/fzobwfow/janae_cram.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/gyyhgk2m/busra_sengul-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/gyyhgk2m/busra_sengul-1.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/hrybwhjk/7373036208_30257976a0_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/hrybwhjk/7373036208_30257976a0_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/inefcvn3/4730684907_8a7f8759cb_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/inefcvn3/4730684907_8a7f8759cb_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/ipojkdd2/carole.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/ipojkdd2/carole.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/jdnh1nyd/5852022091_87c5d045ab_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/jdnh1nyd/5852022091_87c5d045ab_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/jhmnxmkc/heather.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/jhmnxmkc/heather.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/kw2btapv/sophie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/kw2btapv/sophie.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/m5xlws44/busra_sengul.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/m5xlws44/busra_sengul.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/nbrdm1dz/emma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/nbrdm1dz/emma.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/nhjhj1wp/erica_quessenberry.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/nhjhj1wp/erica_quessenberry.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/phdj3qhd/5852022211_9028df67c0_b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/phdj3qhd/5852022211_9028df67c0_b.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/sicdivlf/sofie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/sicdivlf/sofie.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/uetpbykg/poorinma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/uetpbykg/poorinma.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/uoqevap5/busra_sengul-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/uoqevap5/busra_sengul-1.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/uwvlvnzi/lotte.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/uwvlvnzi/lotte.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/vvlnw31z/emmanuel_tissera.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/vvlnw31z/emmanuel_tissera.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/vwojnqfl/jeavon-leopold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/vwojnqfl/jeavon-leopold.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/wupnyv5c/laura.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/wupnyv5c/laura.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/media/zt1cuzq0/16403439029_f500be349b_o.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umbraco/Umbraco.Docs.Samples/01750c2b30da48caac94ab31a7baa3b82fa44181/Umbraco.Docs.Samples.Web/wwwroot/media/zt1cuzq0/16403439029_f500be349b_o.jpg -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/scripts/test-script1.js: -------------------------------------------------------------------------------- 1 | console.log("hello docs"); -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/scripts/test-script2.js: -------------------------------------------------------------------------------- 1 | console.log("hello docs again"); -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.Web/wwwroot/scripts/umbraco-starterkit-app.js: -------------------------------------------------------------------------------- 1 | !function e(o, r, n) { 2 | function a(l, t) { 3 | if (!r[l]) { 4 | if (!o[l]) { 5 | var s = "function" == typeof require && require; 6 | if (!t && s) return s(l, !0); 7 | if (i) return i(l, !0); 8 | var c = new Error("Cannot find module '" + l + "'"); 9 | throw c.code = "MODULE_NOT_FOUND", c 10 | } 11 | var d = r[l] = { exports: {} }; 12 | o[l][0].call(d.exports, 13 | function(e) { 14 | var r = o[l][1][e]; 15 | return a(r ? r : e) 16 | }, 17 | d, 18 | d.exports, 19 | e, 20 | o, 21 | r, 22 | n) 23 | } 24 | return r[l].exports 25 | } 26 | 27 | for (var i = "function" == typeof require && require, l = 0; l < n.length; l++) a(n[l]); 28 | return a 29 | }({ 30 | 1: [ 31 | function(e, o, r) { 32 | !function() { 33 | "use strict"; 34 | $(document).ready(function() { 35 | $(window).bind("scroll", 36 | function() { 37 | var e = 150; 38 | $(window).scrollTop() > e 39 | ? $(".header").addClass("header--fixed") 40 | : $(".header").removeClass("header--fixed") 41 | }), $(".mobile-nav-handler").click(function(e) { 42 | $(".mobile-nav").toggleClass("mobile-nav--open"), $(".header").toggleClass("header--hide"), 43 | $("body").toggleClass("no-scroll"), $("#toggle-nav").toggleClass("active") 44 | }), $(".nav-link").click(function(e) { 45 | $(".mobile-nav").removeClass("mobile-nav--open"), $(".header").removeClass("header--hide"), 46 | $("body").removeClass("no-scroll"), $("#toggle-nav").removeClass("active") 47 | }) 48 | }) 49 | }() 50 | }, {} 51 | ] 52 | }, 53 | {}, 54 | [1]); -------------------------------------------------------------------------------- /Umbraco.Docs.Samples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.31911.260 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Docs.Samples.Web", "Umbraco.Docs.Samples.Web\Umbraco.Docs.Samples.Web.csproj", "{A0474C3A-C80D-4BD1-A387-09F50045CD35}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CEC523F0-C9EA-4231-9C01-FA3E775BBDCB}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | .gitignore = .gitignore 12 | .github\workflows\dotnet.yml = .github\workflows\dotnet.yml 13 | README.md = README.md 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {A0474C3A-C80D-4BD1-A387-09F50045CD35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {A0474C3A-C80D-4BD1-A387-09F50045CD35}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {A0474C3A-C80D-4BD1-A387-09F50045CD35}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {A0474C3A-C80D-4BD1-A387-09F50045CD35}.Release|Any CPU.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {7B1BF2C6-2FE7-415F-B6E7-342B30077C02} 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0", 4 | "rollForward": "latestMinor", 5 | "allowPrerelease": true 6 | } 7 | } --------------------------------------------------------------------------------