├── .gitignore ├── readme.md ├── src ├── DoStuff.Client │ ├── Constants.cs │ ├── Controllers │ │ ├── DoStuffClientApiController.cs │ │ └── DoStuffClientApiControllerBase.cs │ ├── DependencyInjection │ │ ├── DoStuffClient.cs │ │ ├── DoStuffClientApi.cs │ │ ├── DoStuffManifestReader.cs │ │ └── readme.md │ ├── DoStuff.Client.csproj │ ├── DoStuffClient │ │ ├── .vscode │ │ │ └── extensions.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── readme.md │ │ ├── scripts │ │ │ └── generate-openapi.js │ │ ├── src │ │ │ ├── api │ │ │ │ ├── index.ts │ │ │ │ ├── services.gen.ts │ │ │ │ └── types.gen.ts │ │ │ ├── bundle.manifests.ts │ │ │ ├── entrypoints │ │ │ │ ├── entrypoint.ts │ │ │ │ └── manifest.ts │ │ │ ├── lang │ │ │ │ ├── files │ │ │ │ │ ├── dk.ts │ │ │ │ │ └── en.ts │ │ │ │ ├── manifest.ts │ │ │ │ └── readme.md │ │ │ └── sections │ │ │ │ └── manifest.ts │ │ ├── tsconfig.json │ │ └── vite.config.ts │ └── README.txt ├── DoStuff.Core │ ├── DoStuff.Core.csproj │ ├── DoStuffCoreBuilderExtensions.cs │ └── NotificationHandlers │ │ ├── ContentNotificationAsyncHandler.cs │ │ ├── NotificationBuilderExtensions.cs │ │ └── readme.md ├── DoStuff.Website │ ├── .gitignore │ ├── DoStuff.Website.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Views │ │ ├── Partials │ │ │ ├── blockgrid │ │ │ │ ├── area.cshtml │ │ │ │ ├── areas.cshtml │ │ │ │ ├── default.cshtml │ │ │ │ └── items.cshtml │ │ │ └── blocklist │ │ │ │ └── default.cshtml │ │ └── _ViewImports.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ └── favicon.ico ├── DoStuff.sln └── DoStuff │ ├── DoStuff.cs │ ├── DoStuff.csproj │ └── DoStuffComposer.cs └── where └── index.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # Tye 66 | .tye/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd 366 | 367 | ## 368 | ## Visual studio for Mac 369 | ## 370 | 371 | 372 | # globs 373 | Makefile.in 374 | *.userprefs 375 | *.usertasks 376 | config.make 377 | config.status 378 | aclocal.m4 379 | install-sh 380 | autom4te.cache/ 381 | *.tar.gz 382 | tarballs/ 383 | test-results/ 384 | 385 | # Mac bundle stuff 386 | *.dmg 387 | *.app 388 | 389 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 390 | # General 391 | .DS_Store 392 | .AppleDouble 393 | .LSOverride 394 | 395 | # Icon must end with two \r 396 | Icon 397 | 398 | 399 | # Thumbnails 400 | ._* 401 | 402 | # Files that might appear in the root of a volume 403 | .DocumentRevisions-V100 404 | .fseventsd 405 | .Spotlight-V100 406 | .TemporaryItems 407 | .Trashes 408 | .VolumeIcon.icns 409 | .com.apple.timemachine.donotpresent 410 | 411 | # Directories potentially created on remote AFP share 412 | .AppleDB 413 | .AppleDesktop 414 | Network Trash Folder 415 | Temporary Items 416 | .apdisk 417 | 418 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 419 | # Windows thumbnail cache files 420 | Thumbs.db 421 | ehthumbs.db 422 | ehthumbs_vista.db 423 | 424 | # Dump file 425 | *.stackdump 426 | 427 | # Folder config file 428 | [Dd]esktop.ini 429 | 430 | # Recycle Bin used on file shares 431 | $RECYCLE.BIN/ 432 | 433 | # Windows Installer files 434 | *.cab 435 | *.msi 436 | *.msix 437 | *.msm 438 | *.msp 439 | 440 | # Windows shortcuts 441 | *.lnk 442 | 443 | # JetBrains Rider 444 | .idea/ 445 | *.sln.iml 446 | 447 | ## 448 | ## Visual Studio Code 449 | ## 450 | .vscode/* 451 | !.vscode/settings.json 452 | !.vscode/tasks.json 453 | !.vscode/launch.json 454 | !.vscode/extensions.json 455 | 456 | ## 457 | ## Umbraco CMS 458 | ## 459 | 460 | # JSON schema files for appsettings.json 461 | appsettings-schema.json 462 | appsettings-schema.*.json 463 | 464 | # JSON schema file for umbraco-package.json 465 | umbraco-package-schema.json 466 | 467 | # Packages created from the backoffice (package.xml/package.zip) 468 | /umbraco/Data/CreatedPackages/ 469 | 470 | # Temp folder containing Examine indexes, NuCache, MediaCache, etc. 471 | /umbraco/Data/TEMP/ 472 | 473 | # SQLite database files 474 | /umbraco/Data/*.sqlite.db 475 | /umbraco/Data/*.sqlite.db-shm 476 | /umbraco/Data/*.sqlite.db-wal 477 | 478 | # Log files 479 | /umbraco/Logs/ 480 | 481 | # Media files 482 | /wwwroot/media/ 483 | 484 | # Ignore template scripts 485 | /.template/ 486 | 487 | # Ignore Generated client files 488 | **/DoStuff.Client/wwwroot/ 489 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Do Stuff with Umbraco 💪 - Fifteen. 2 | 3 | This is the v15 edition of the DoStuffWithumbraco Repository 4 | 5 | > [!NOTE] 6 | > This is a work in progress - see the checklists below as we flesh out the exmaples here. 7 | 8 | Tips, Patterns, and code that will help you achive things with the Umbraco codebase. 9 | 10 | ## Where is X 11 | 12 | If you are new to the webcomponents, typescript world of Umbraco v14 and beyond, quite a lot has changed on the client side. 13 | 14 | - [Where is X](./where/index.md) 15 | 16 | ## Snippets 17 | 18 | Quick examples of how to do things. 19 | 20 | ### Server Code (C#) 21 | 22 | - [x] [Compositions (Dependency Injection)](./src/DoStuff.Client/DependencyInjection/readme.md) 23 | - [x] [Notifications / Handlers](./src//DoStuff.Core/NotificationHandlers/readme.md) 24 | - [ ] Options (reading/using appsettings) 25 | - [ ] Migrations 26 | - [ ] Health Checks 27 | - [ ] WebHooks 28 | - [ ] Background Tasks 29 | 30 | ### Front End (Typescript and Lit) 31 | 32 | - [x] [Section](./src/DoStuff.Client/DoStuffClient/src/sections/manifest.ts) 33 | - [ ] Dashboards 34 | - [ ] Actions (Menu Items) 35 | - [ ] Workspaces 36 | - [ ] Trees 37 | - [ ] Property editors 38 | - [ ] SignlaR 39 | - [ ] Modal dialogs 40 | - [x] [Localization](./src/DoStuff.Client/DoStuffClient/src/lang/readme.md) 41 | - [ ] Custom Icons 42 | - [ ] Conditions 43 | - [ ] Permissions 44 | 45 | ### Concepts 46 | 47 | Not always umbraco, but how some of the Lit/Web-Components/Typescript things fit together with umbraco development. 48 | 49 | - [x] Manifest Filters (loading package from c#) 📝[DoStuffManifestReader.cs](./src/DoStuff.Client/DependencyInjection/DoStuffManifestReader.cs) 50 | - [ ] Components 51 | - [ ] Contexts 52 | - [ ] Repositories 53 | - [ ] Stores 54 | 55 | ## Patterns 56 | 57 | Slighty more involved concepts and code that require a few diffrent things 58 | 59 | - [ ] Database Repository / Service Pattern 60 | - [ ] Management API/Swagger Pattern 61 | 62 | # Project Structure 63 | 64 | This project is structured as if you are building something large with many 65 | moving parts, splitting the project helps you manage that, and swap bits in 66 | and out as versions of things change. 67 | 68 | - **DoStuff.Client** - Client Library for the front end typescript/api 69 | - **DoStuff.Core** - Core backend stuff like databases, services, etc. 70 | - **DoStuff** - A Parent solution, so you include/publish this one. 71 | - **DoStuff.Website** - A website where everything runs / is included. 72 | -------------------------------------------------------------------------------- /src/DoStuff.Client/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace DoStuff.Client 2 | { 3 | public class Constants 4 | { 5 | public const string ApiName = "dostuffclient"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/DoStuff.Client/Controllers/DoStuffClientApiController.cs: -------------------------------------------------------------------------------- 1 | using Asp.Versioning; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace DoStuff.Client.Controllers 6 | { 7 | [ApiVersion("1.0")] 8 | [ApiExplorerSettings(GroupName = "DoStuff.Client")] 9 | public class DoStuffClientApiController : DoStuffClientApiControllerBase 10 | { 11 | 12 | [HttpGet("ping")] 13 | [ProducesResponseType(StatusCodes.Status200OK)] 14 | public string Ping() => "Pong"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DoStuff.Client/Controllers/DoStuffClientApiControllerBase.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Umbraco.Cms.Api.Common.Attributes; 4 | using Umbraco.Cms.Web.Common.Authorization; 5 | using Umbraco.Cms.Web.Common.Routing; 6 | 7 | namespace DoStuff.Client.Controllers 8 | { 9 | [ApiController] 10 | [BackOfficeRoute("dostuffclient/api/v{version:apiVersion}")] 11 | [Authorize(Policy = AuthorizationPolicies.SectionAccessContent)] 12 | [MapToApi(Constants.ApiName)] 13 | public class DoStuffClientApiControllerBase : ControllerBase 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DependencyInjection/DoStuffClient.cs: -------------------------------------------------------------------------------- 1 | using Umbraco.Cms.Core.DependencyInjection; 2 | using DoStuff.Client.DependencyInjection; 3 | 4 | namespace DoStuff.Client.Composers; 5 | 6 | public static class DoStuffClient 7 | { 8 | public static IUmbracoBuilder AddDoStuffClient(this IUmbracoBuilder builder) 9 | { 10 | builder.AddDoStuffClientApi(); 11 | builder.AddDoStuffManifestReader(); 12 | return builder; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DependencyInjection/DoStuffClientApi.cs: -------------------------------------------------------------------------------- 1 | using Asp.Versioning; 2 | using Microsoft.AspNetCore.Mvc.ApiExplorer; 3 | using Microsoft.AspNetCore.Mvc.Controllers; 4 | using Microsoft.Extensions.Options; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.OpenApi.Models; 7 | using Swashbuckle.AspNetCore.SwaggerGen; 8 | using Umbraco.Cms.Core.DependencyInjection; 9 | using Umbraco.Cms.Api.Management.OpenApi; 10 | using Umbraco.Cms.Api.Common.OpenApi; 11 | 12 | namespace DoStuff.Client.Composers; 13 | 14 | public static class DoStuffClientApi { 15 | 16 | public static IUmbracoBuilder AddDoStuffClientApi(this IUmbracoBuilder builder) { 17 | builder.Services.AddSingleton(); 18 | 19 | builder.Services.Configure(opt => 20 | { 21 | // Related documentation: 22 | // https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-backoffice-api 23 | // https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-backoffice-api/adding-a-custom-swagger-document 24 | // https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-backoffice-api/versioning-your-api 25 | // https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-backoffice-api/access-policies 26 | 27 | // Configure the Swagger generation options 28 | // Add in a new Swagger API document solely for our own package that can be browsed via Swagger UI 29 | // Along with having a generated swagger JSON file that we can use to auto generate a TypeScript client 30 | opt.SwaggerDoc(Constants.ApiName, new OpenApiInfo 31 | { 32 | Title = "Do Stuff Client Backoffice API", 33 | Version = "1.0", 34 | // Contact = new OpenApiContact 35 | // { 36 | // Name = "Some Developer", 37 | // Email = "you@company.com", 38 | // Url = new Uri("https://company.com") 39 | // } 40 | }); 41 | 42 | // Enable Umbraco authentication for the "Example" Swagger document 43 | // PR: https://github.com/umbraco/Umbraco-CMS/pull/15699 44 | opt.OperationFilter(); 45 | }); 46 | 47 | return builder; 48 | } 49 | 50 | public class DoStuffClientOperationSecurityFilter : BackOfficeSecurityRequirementsOperationFilterBase 51 | { 52 | protected override string ApiName => Constants.ApiName; 53 | } 54 | 55 | // This is used to generate nice operation IDs in our swagger json file 56 | // So that the gnerated TypeScript client has nice method names and not too verbose 57 | // https://docs.umbraco.com/umbraco-cms/tutorials/creating-a-backoffice-api/umbraco-schema-and-operation-ids#operation-ids 58 | public class CustomOperationHandler : OperationIdHandler 59 | { 60 | public CustomOperationHandler(IOptions apiVersioningOptions) : base(apiVersioningOptions) 61 | { 62 | } 63 | 64 | protected override bool CanHandle(ApiDescription apiDescription, ControllerActionDescriptor controllerActionDescriptor) 65 | { 66 | return controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("DoStuff.Client.Controllers", comparisonType: StringComparison.InvariantCultureIgnoreCase) is true; 67 | } 68 | 69 | public override string Handle(ApiDescription apiDescription) => $"{apiDescription.ActionDescriptor.RouteValues["action"]}"; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DependencyInjection/DoStuffManifestReader.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | using System.Text.Json.Nodes; 4 | 5 | using Umbraco.Cms.Core.DependencyInjection; 6 | using Umbraco.Cms.Core.Manifest; 7 | using Umbraco.Cms.Infrastructure.Manifest; 8 | 9 | namespace DoStuff.Client.DependencyInjection; 10 | 11 | /// 12 | /// Extension point so the manifest reader can be added to a composer. 13 | /// 14 | /// 15 | /// 16 | /// builder.AddDoStuffManifestReader(); 17 | /// 18 | /// 19 | internal static class DoStuffManifestReaderBuilderExtensions 20 | { 21 | public static IUmbracoBuilder AddDoStuffManifestReader(this IUmbracoBuilder builder) 22 | { 23 | builder.Services.AddSingleton(); 24 | return builder; 25 | } 26 | } 27 | 28 | /// 29 | /// package manifest reader, adds the manifest for the package directly to the loaded 30 | /// list of manifests (bypassing the need for an umbraco-package.json file. 31 | /// 32 | /// 33 | /// the advantage of this method is that you can use the version of the compiled code 34 | /// in the package, so you don't have to do any build steps to manually alter a json 35 | /// file. 36 | /// 37 | /// you can also add the version as query parameter to the javascript file and this 38 | /// helps break any caching issues that might occur when you update the package. 39 | /// 40 | internal class DoStuffManifestReader : IPackageManifestReader 41 | { 42 | public Task> ReadPackageManifestsAsync() 43 | { 44 | var versionString = typeof(DoStuffManifestReader).Assembly.GetName().Version?.ToString(3) ?? "0.0.0"; 45 | 46 | List manifests = [ 47 | new PackageManifest 48 | { 49 | Id = "DoStuff.Client", 50 | Name = "DoStuff.Client", 51 | Version = versionString, 52 | AllowTelemetry = true, 53 | Extensions = [ 54 | new JsonObject { 55 | ["name"] = "DoStuff Client Bundle", 56 | ["alias"] = "DoStuff.Client.Bundle", 57 | ["type"] = "bundle", 58 | ["js"] = $"/App_Plugins/DoStuffClient/do-stuff-client.js?version={versionString}" 59 | }] 60 | } 61 | ]; 62 | 63 | return Task.FromResult(manifests.AsEnumerable()); 64 | } 65 | } -------------------------------------------------------------------------------- /src/DoStuff.Client/DependencyInjection/readme.md: -------------------------------------------------------------------------------- 1 | # Dependency Injection / Composers 2 | 3 | [Dependency injection in .net](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection) allows you to quickly and easily add components and use them accross your projects with minial configuration and a level of abstraction that gives you a flexible code base. 4 | 5 | For a traditional ASP.Net site you might add your services and components to the program.cs file and then your site would load them up. 6 | 7 | but for umbraco it is advisable not to change the program.cs file, and instead use the [Umbraco Composer feature](https://docs.umbraco.com/umbraco-cms/reference/using-ioc) to load any required services,configuration or components during startup of a project. 8 | 9 | > [!NOTE] 10 | > The Umbraco documentation suggests you might want to alter program.cs to add services, but in our experience you want to avoid this. 11 | > Any changes to the program.cs between versions of Umbraco can cause you upgrade issues if you have changed the file, and you can do almost everything you need via the composers. 12 | 13 | ## Pattern : Seperate Composer from Code. 14 | 15 | It is very tempting (and not really wrong) to add all of the code you need to register at startup directly into your composer method, 16 | 17 | ```cs 18 | public class MyComposer : IComposer 19 | { 20 | public void Compose(IUmbracoBuilder builder) 21 | { 22 | builder.Services.AddSingleton(); 23 | } 24 | } 25 | ``` 26 | 27 | but for larger projects this can quickly get quite messy quite quickly and before you know it you can have 100's of lines of code all registering diffrent things. 28 | 29 | The Umbraco source follows a diffrent pattern where Extensions are used to register and configure descreet elements of functionality, that can then be referenced in the composer. 30 | 31 | ```cs 32 | internal static class MySuperServiceExtension { 33 | 34 | public static IUmbracoBuilder AddMySuperService(this IUmbracoBuilder builder) { 35 | 36 | builder.Services.AddSingleton(); 37 | 38 | } 39 | } 40 | ``` 41 | 42 | this can then be added to the composer as a single line 43 | 44 | ````cs 45 | ```cs 46 | public class MyComposer : IComposer 47 | { 48 | public void Compose(IUmbracoBuilder builder) 49 | { 50 | builder.AddMySuperService() 51 | } 52 | } 53 | ```` 54 | 55 | this keeps things seperated and makes it easier to find the logic that sets up a block of functionaltiy. 56 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuff.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | enable 5 | enable 6 | / 7 | 8 | 9 | 10 | DoStuff.Client 11 | DoStuff.Client 12 | DoStuff.Client 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "runem.lit-plugin" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "do-stuff-client", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "watch": "tsc && vite build --watch", 8 | "build": "tsc && vite build", 9 | "generate-client": "node scripts/generate-openapi.js https://localhost:5000/umbraco/swagger/dostuffclient/swagger.json" 10 | }, 11 | "devDependencies": { 12 | "@hey-api/client-fetch": "^0.4.2", 13 | "@hey-api/openapi-ts": "^0.53.11", 14 | "@umbraco-cms/backoffice": "^*", 15 | "chalk": "^5.3.0", 16 | "cross-env": "^7.0.3", 17 | "node-fetch": "^3.3.2", 18 | "typescript": "^5.6.3", 19 | "vite": "^5.4.9" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/readme.md: -------------------------------------------------------------------------------- 1 | # DoStuff Client. 2 | 3 | This is the DoStuff client for the Umbraco backoffice, it contains the typescript files that are used to build the javascript files that live in the `app_plugins/dostuff` folder 4 | 5 | the best way to edit and use this client library is to open this folder in visual studio code (visual studio is good for the backoffice, code is better for the typescript/lit/vite stuff.) 6 | 7 | ## Watch for changes 8 | 9 | if you run `npm run watch' while developing, then 10 | 11 | - Anything you save will be built by the typescript/vite commands and placed in the `app_plugins` folder of the client project. 12 | - Because the client project is a Razor Class Library this also means that the website project will detect these changes 13 | - If you have the "browser link" feature enabled in visual studio this will trigger a reload of your web-browser. 14 | - If you have the web-browser inspect window open with 'disable cache' checked, then your changes will be included in the re-load. 15 | 16 | So with all the bits lined up, save a file, see the change in the web-browser 17 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/scripts/generate-openapi.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | import chalk from 'chalk'; 3 | import { createClient } from '@hey-api/openapi-ts'; 4 | 5 | // Start notifying user we are generating the TypeScript client 6 | console.log(chalk.green("Generating OpenAPI client...")); 7 | 8 | const swaggerUrl = process.argv[2]; 9 | if (swaggerUrl === undefined) { 10 | console.error(chalk.red(`ERROR: Missing URL to OpenAPI spec`)); 11 | console.error(`Please provide the URL to the OpenAPI spec as the first argument found in ${chalk.yellow('package.json')}`); 12 | console.error(`Example: node generate-openapi.js ${chalk.yellow('https://localhost:44331/umbraco/swagger/REPLACE_ME/swagger.json')}`); 13 | process.exit(); 14 | } 15 | 16 | // Needed to ignore self-signed certificates from running Umbraco on https on localhost 17 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; 18 | 19 | // Start checking to see if we can connect to the OpenAPI spec 20 | console.log("Ensure your Umbraco instance is running"); 21 | console.log(`Fetching OpenAPI definition from ${chalk.yellow(swaggerUrl)}`); 22 | 23 | fetch(swaggerUrl).then(response => { 24 | if (!response.ok) { 25 | console.error(chalk.red(`ERROR: OpenAPI spec returned with a non OK (200) response: ${response.status} ${response.statusText}`)); 26 | console.error(`The URL to your Umbraco instance may be wrong or the instance is not running`); 27 | console.error(`Please verify or change the URL in the ${chalk.yellow('package.json')} for the script ${chalk.yellow('generate-openapi')}`); 28 | return; 29 | } 30 | 31 | console.log(`OpenAPI spec fetched successfully`); 32 | console.log(`Calling ${chalk.yellow('hey-api')} to generate TypeScript client`); 33 | 34 | createClient({ 35 | client: '@hey-api/client-fetch', 36 | input: swaggerUrl, 37 | output: 'src/api', 38 | services: { 39 | asClass: true, 40 | } 41 | }); 42 | 43 | }) 44 | .catch(error => { 45 | console.error(`ERROR: Failed to connect to the OpenAPI spec: ${chalk.red(error.message)}`); 46 | console.error(`The URL to your Umbraco instance may be wrong or the instance is not running`); 47 | console.error(`Please verify or change the URL in the ${chalk.yellow('package.json')} for the script ${chalk.yellow('generate-openapi')}`); 48 | }); 49 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/api/index.ts: -------------------------------------------------------------------------------- 1 | // This file is auto-generated by @hey-api/openapi-ts 2 | export * from './services.gen'; 3 | export * from './types.gen'; 4 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/api/services.gen.ts: -------------------------------------------------------------------------------- 1 | // This file is auto-generated by @hey-api/openapi-ts 2 | 3 | import { createClient, createConfig, type Options } from '@hey-api/client-fetch'; 4 | import type { PingError, PingResponse } from './types.gen'; 5 | 6 | export const client = createClient(createConfig()); 7 | 8 | export class DoStuffClientService { 9 | public static ping(options?: Options) { 10 | return (options?.client ?? client).get({ 11 | ...options, 12 | url: '/umbraco/dostuffclient/api/v1/ping' 13 | }); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/api/types.gen.ts: -------------------------------------------------------------------------------- 1 | // This file is auto-generated by @hey-api/openapi-ts 2 | export type PingResponse = (string); 3 | 4 | export type PingError = (unknown); 5 | //#endif 6 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/bundle.manifests.ts: -------------------------------------------------------------------------------- 1 | import { manifests as entrypoints } from "./entrypoints/manifest"; 2 | 3 | // out manifests 4 | import { manifests as sections } from "./sections/manifest"; 5 | import { manifests as localizations } from "./lang/manifest"; 6 | 7 | // Job of the bundle is to collate all the manifests from different parts of the extension and load other manifests 8 | // We load this bundle from umbraco-package.json 9 | export const manifests: Array = [ 10 | ...entrypoints, 11 | ...sections, 12 | ...localizations, 13 | ]; 14 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/entrypoints/entrypoint.ts: -------------------------------------------------------------------------------- 1 | import { UmbEntryPointOnInit, UmbEntryPointOnUnload } from '@umbraco-cms/backoffice/extension-api'; 2 | 3 | // load up the manifests here 4 | export const onInit: UmbEntryPointOnInit = (_host, _extensionRegistry) => { 5 | 6 | console.log('Hello from my extension 🎉'); 7 | }; 8 | 9 | export const onUnload: UmbEntryPointOnUnload = (_host, _extensionRegistry) => { 10 | console.log('Goodbye from my extension 👋'); 11 | }; 12 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/entrypoints/manifest.ts: -------------------------------------------------------------------------------- 1 | export const manifests: Array = [ 2 | { 3 | name: "Do Stuff Client Entrypoint", 4 | alias: "DoStuff.Client.Entrypoint", 5 | type: "backofficeEntryPoint", 6 | js: () => import("./entrypoint"), 7 | } 8 | ]; 9 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/lang/files/dk.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | dostuff: { 3 | name: "Gør ting", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/lang/files/en.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | dostuff: { 3 | name: "Do Stuff", 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/lang/manifest.ts: -------------------------------------------------------------------------------- 1 | const localizations: UmbExtensionManifest[] = [ 2 | { 3 | type: "localization", 4 | alias: "do-stuff-localization-en", 5 | name: "Do Stuff Localization (en)", 6 | weight: 0, 7 | meta: { culture: "en" }, 8 | js: () => import("./files/en.js"), 9 | }, 10 | { 11 | type: "localization", 12 | alias: "do-stuff-localization-dk", 13 | name: "Do Stuff Localization (dk)", 14 | weight: 0, 15 | meta: { culture: "dk" }, 16 | js: () => import("./files/dk.js"), 17 | }, 18 | ]; 19 | 20 | export const manifests = [...localizations]; 21 | -------------------------------------------------------------------------------- /src/DoStuff.Client/DoStuffClient/src/lang/readme.md: -------------------------------------------------------------------------------- 1 | # Localization (Client) 2 | 3 | You can localize your client UI by adding your own localization manifests for diffrent languages. 4 | 5 | Localization lets you make your UI multi-lingual but it also allows you to remove any hardcoded strings from around your app and have them in one place so its easier to edit / pass to someone who can spell. 6 | 7 | ## Register manifest. 8 | 9 | the localization manifest entry, tells umbraco the language and where the file containing the strings exists. 10 | 11 | ```ts 12 | { 13 | type: "localization", 14 | alias: "do-stuff-localization-en", 15 | name: "Do Stuff Localization (en)", 16 | weight: 0, 17 | meta: { culture: "en" }, 18 | js: () => import("./files/en.js"), 19 | }, 20 | ``` 21 | 22 | > [!NOTE] 23 | > The default language fallback will likely be 'en' so having an 'en' file ensures you will at least have some values for your site. 24 | 25 | ## The file. 26 | 27 | the localized text exists in a file that exports a object with all the values. 28 | 29 | ```ts 30 | export default { 31 | dostuff: { 32 | name: "Do Stuff", 33 | }, 34 | }; 35 | ``` 36 | 37 | here the values are under the `dostuff` namespace, so would be referenced `dostuff_name` 38 | 39 | ## using. 40 | 41 | ### in a template 42 | 43 | the `` component can be used to fetch a string 44 | 45 | ```html 46 | <| || __/ | | \__ \ | (_) | | | | 11 | \__,_|_| |_| |_|_.__/|_| \__,_|\___\___/ \___/_/\_\\__\___|_| |_|___/_|\___/|_| |_| 12 | 13 | 14 | == Requirements == 15 | * Node LTS Version 20.17.0+ 16 | * Use a tool such as NVM (Node Version Manager) for your OS to help manage multiple versions of Node 17 | 18 | == Node Version Manager tools == 19 | * https://github.com/coreybutler/nvm-windows 20 | * https://github.com/nvm-sh/nvm 21 | * https://docs.volta.sh/guide/getting-started 22 | 23 | == Steps == 24 | * Open a terminal inside the `\Client` folder 25 | * Run `npm install` to install all the dependencies 26 | * Run `npm run build` to build the project 27 | * The build output is copied to `wwwroot\App_Plugins\DoStuffClient\do-stuff-client.js` 28 | 29 | == File Watching == 30 | * Add this Razor Class Library Project as a project reference to an Umbraco Website project 31 | * From the `\Client` folder run the command `npm run watch` this will monitor the changes to the *.ts files and rebuild the project 32 | * With the Umbraco website project running the Razor Class Library Project will refresh the browser when the build is complete 33 | 34 | == Suggestion == 35 | * Use VSCode as the editor of choice as it has good tooling support for TypeScript and it will recommend a VSCode Extension for good Lit WebComponent completions 36 | 37 | == Other Resources == 38 | * Umbraco Docs - https://docs.umbraco.com/umbraco-cms/customizing/overview 39 | -------------------------------------------------------------------------------- /src/DoStuff.Core/DoStuff.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/DoStuff.Core/DoStuffCoreBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using DoStuff.Core.NotificationHandlers; 2 | 3 | using Umbraco.Cms.Core.DependencyInjection; 4 | 5 | namespace DoStuff.Core; 6 | 7 | public static class DoStuffCoreBuilderExtensions 8 | { 9 | public static IUmbracoBuilder AddDoStuffCore(this IUmbracoBuilder builder) 10 | { 11 | builder.AddDoStuffNotificationHandlers(); 12 | return builder; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DoStuff.Core/NotificationHandlers/ContentNotificationAsyncHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Umbraco.Cms.Core.Events; 8 | using Umbraco.Cms.Core.Notifications; 9 | 10 | namespace DoStuff.Core.NotificationHandlers; 11 | 12 | internal class ContentNotificationAsyncHandler : 13 | INotificationAsyncHandler, 14 | INotificationAsyncHandler 15 | { 16 | 17 | /// 18 | /// ContentSavingNotification - Fires when content is saving. (but not yet saved). 19 | /// 20 | /// 21 | /// you can cancel a 'saving' notification and it will stop the operation in umbraco. 22 | /// 23 | public Task HandleAsync(ContentSavingNotification notification, CancellationToken cancellationToken) 24 | { 25 | foreach(var entity in notification.SavedEntities) 26 | { 27 | if (entity.Name?.Contains("stop", StringComparison.InvariantCultureIgnoreCase) is true) 28 | { 29 | notification.CancelOperation(new EventMessage("Blocked", "You cannot save content with the word 'stop' in the name", EventMessageType.Error)); 30 | notification.Cancel = true; 31 | 32 | return Task.CompletedTask; 33 | } 34 | 35 | if (entity.Name?.Contains("pass", StringComparison.InvariantCultureIgnoreCase) is true) 36 | { 37 | // you can also store things in the notification state, so they can be passed between 38 | // as '...ing' and '..ed' state 39 | notification.State["HasPass"] = true; 40 | } 41 | } 42 | 43 | return Task.CompletedTask; 44 | 45 | } 46 | 47 | /// 48 | /// handles when an content item has been saved 49 | /// 50 | /// 51 | /// Save will also file when something is being published 52 | /// 53 | public Task HandleAsync(ContentSavedNotification notification, CancellationToken cancellationToken) 54 | { 55 | if (notification.State.TryGetValue("HasPass", out var hasPass) is true || hasPass is true) 56 | { 57 | // the content has a 'pass' in it, so we might do something different here. 58 | } 59 | 60 | foreach(var entity in notification.SavedEntities) 61 | { 62 | // process each saved entity in the notification. 63 | } 64 | 65 | return Task.CompletedTask; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/DoStuff.Core/NotificationHandlers/NotificationBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Umbraco.Cms.Core.DependencyInjection; 8 | using Umbraco.Cms.Core.Notifications; 9 | 10 | namespace DoStuff.Core.NotificationHandlers; 11 | 12 | internal static class NotificationBuilderExtensions 13 | { 14 | public static IUmbracoBuilder AddDoStuffNotificationHandlers(this IUmbracoBuilder builder) 15 | { 16 | // register our notification handlers to process things when something happens. 17 | builder.AddNotificationAsyncHandler() 18 | .AddNotificationAsyncHandler(); 19 | 20 | return builder; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DoStuff.Core/NotificationHandlers/readme.md: -------------------------------------------------------------------------------- 1 | # Notification handlers. 2 | 3 | When things change or are about to change, Umbraco will fire out Notification message to anything that has registered as a notification handler for that event. [Notification Handlers](https://docs.umbraco.com/umbraco-cms/reference/notifications/notification-handler) are the peices of code you can write to receive and mange these events. 4 | 5 | ## Notitification Handler 6 | 7 | A Notification handler will impliment `INotificationHandler` or `INotificationAsyncHandler` (if you have async methods). the main method 8 | here is the `Handle` method which will be called with details of the notification. 9 | 10 | for example when content is saved the ContentSavedNotification handle method will look like. 11 | 12 | ```cs 13 | public Task HandleAsync(ContentSavedNotification notification, CancellationToken cancellationToken) 14 | { 15 | fore (var entity in notification.SavedEntities) { 16 | // do stuff each item in the notification. 17 | } 18 | } 19 | ``` 20 | 21 | ## Cancelling a notification 22 | 23 | Some notifications can be cancled, and stop the operation withing umbraco. 24 | 25 | For example you can stop a peice of content from being saved by cancelling the `ContentSavingNotification` 26 | 27 | ```cs 28 | public void Handle(ContentSavingNotification notification, CancellationToken cancellationToken) 29 | { 30 | 31 | // some logic that makes us want to stop the save event 32 | notification.CancelOperation(new EventMessage("Blocked", "Save blocked", EventMessageType.Error)); 33 | notification.Cancel = true; 34 | } 35 | ``` 36 | 37 | > [!NOTE] 38 | > While a lot of notifications will pass an array of items, at this time Umbraco very rearly / never passes an array of items to a notification 39 | > Even when notifications are batched up, Umbraco sends one per item. 40 | 41 | ## Registering 42 | 43 | Notification handlers must be registred at startup either in the composer or your extension methods (see [dependency injection](../../DoStuff.Client/DependencyInjection/readme.md). 44 | 45 | ```cs 46 | // register our notification handlers to process things when something happens. 47 | builder.AddNotificationAsyncHandler() 48 | .AddNotificationAsyncHandler(); 49 | ``` 50 | 51 | > The `AddNotificationHandler` method returns IUmbracoBuilder, so these notifications can be chained together 52 | 53 | ## Delayed notifications. 54 | 55 | Some operations (such as imports from uSync or Umbraco.Deploy) will delay some notifications until they have been completed. 56 | 57 | Notifications that cannot be canceled (such as ContentSaved) may not fire as the content is saved but after a batch of content has been saved, therefore you can't reley on the ordering or timing of this event to do something else with the content. Mostly this isn't an issue but its good to be aware. 58 | 59 | ## Adding Notifications 60 | 61 | [TODO - See Custom Notifications.] 62 | -------------------------------------------------------------------------------- /src/DoStuff.Website/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # Tye 66 | .tye/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd 366 | 367 | ## 368 | ## Visual studio for Mac 369 | ## 370 | 371 | 372 | # globs 373 | Makefile.in 374 | *.userprefs 375 | *.usertasks 376 | config.make 377 | config.status 378 | aclocal.m4 379 | install-sh 380 | autom4te.cache/ 381 | *.tar.gz 382 | tarballs/ 383 | test-results/ 384 | 385 | # Mac bundle stuff 386 | *.dmg 387 | *.app 388 | 389 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 390 | # General 391 | .DS_Store 392 | .AppleDouble 393 | .LSOverride 394 | 395 | # Icon must end with two \r 396 | Icon 397 | 398 | 399 | # Thumbnails 400 | ._* 401 | 402 | # Files that might appear in the root of a volume 403 | .DocumentRevisions-V100 404 | .fseventsd 405 | .Spotlight-V100 406 | .TemporaryItems 407 | .Trashes 408 | .VolumeIcon.icns 409 | .com.apple.timemachine.donotpresent 410 | 411 | # Directories potentially created on remote AFP share 412 | .AppleDB 413 | .AppleDesktop 414 | Network Trash Folder 415 | Temporary Items 416 | .apdisk 417 | 418 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 419 | # Windows thumbnail cache files 420 | Thumbs.db 421 | ehthumbs.db 422 | ehthumbs_vista.db 423 | 424 | # Dump file 425 | *.stackdump 426 | 427 | # Folder config file 428 | [Dd]esktop.ini 429 | 430 | # Recycle Bin used on file shares 431 | $RECYCLE.BIN/ 432 | 433 | # Windows Installer files 434 | *.cab 435 | *.msi 436 | *.msix 437 | *.msm 438 | *.msp 439 | 440 | # Windows shortcuts 441 | *.lnk 442 | 443 | # JetBrains Rider 444 | .idea/ 445 | *.sln.iml 446 | 447 | ## 448 | ## Visual Studio Code 449 | ## 450 | .vscode/* 451 | !.vscode/settings.json 452 | !.vscode/tasks.json 453 | !.vscode/launch.json 454 | !.vscode/extensions.json 455 | 456 | ## 457 | ## Umbraco CMS 458 | ## 459 | 460 | # JSON schema files for appsettings.json 461 | appsettings-schema.json 462 | appsettings-schema.*.json 463 | 464 | # JSON schema file for umbraco-package.json 465 | umbraco-package-schema.json 466 | 467 | # Packages created from the backoffice (package.xml/package.zip) 468 | /umbraco/Data/CreatedPackages/ 469 | 470 | # Temp folder containing Examine indexes, NuCache, MediaCache, etc. 471 | /umbraco/Data/TEMP/ 472 | 473 | # SQLite database files 474 | /umbraco/Data/*.sqlite.db 475 | /umbraco/Data/*.sqlite.db-shm 476 | /umbraco/Data/*.sqlite.db-wal 477 | 478 | # Log files 479 | /umbraco/Logs/ 480 | 481 | # Media files 482 | /wwwroot/media/ 483 | -------------------------------------------------------------------------------- /src/DoStuff.Website/DoStuff.Website.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | enable 5 | enable 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 27 | false 28 | false 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/DoStuff.Website/Program.cs: -------------------------------------------------------------------------------- 1 | WebApplicationBuilder builder = WebApplication.CreateBuilder(args); 2 | 3 | builder.CreateUmbracoBuilder() 4 | .AddBackOffice() 5 | .AddWebsite() 6 | .AddComposers() 7 | .Build(); 8 | 9 | WebApplication app = builder.Build(); 10 | 11 | await app.BootUmbracoAsync(); 12 | 13 | 14 | app.UseUmbraco() 15 | .WithMiddleware(u => 16 | { 17 | u.UseBackOffice(); 18 | u.UseWebsite(); 19 | }) 20 | .WithEndpoints(u => 21 | { 22 | u.UseBackOfficeEndpoints(); 23 | u.UseWebsiteEndpoints(); 24 | }); 25 | 26 | await app.RunAsync(); 27 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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:34780", 8 | "sslPort": 44305 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "Umbraco.Web.UI": { 20 | "commandName": "Project", 21 | "dotnetRunMessages": true, 22 | "launchBrowser": true, 23 | "applicationUrl": "https://localhost:44305;http://localhost:34780", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | -------------------------------------------------------------------------------- /src/DoStuff.Website/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Umbraco.Extensions 2 | @using Umbraco.Cms.Web.Common.PublishedModels 3 | @using Umbraco.Cms.Web.Common.Views 4 | @using Umbraco.Cms.Core.Models.PublishedContent 5 | @using Microsoft.AspNetCore.Html 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /src/DoStuff.Website/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "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 | "Hosting": { 26 | "Debug": true 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/DoStuff.Website/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 | "Umbraco": { 14 | "CMS": { 15 | "Global": { 16 | "Id": "bab35a6a-cee4-421b-9477-9abb242ccc2d", 17 | "SanitizeTinyMce": true 18 | }, 19 | "Content": { 20 | "AllowEditInvariantFromNonDefault": true, 21 | "ContentVersionCleanupPolicy": { 22 | "EnableCleanup": true 23 | } 24 | }, 25 | "Unattended": { 26 | "UpgradeUnattended": true 27 | }, 28 | "Security": { 29 | "AllowConcurrentLogins": false 30 | } 31 | } 32 | }, 33 | "ConnectionStrings": { 34 | "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True", 35 | "umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite" 36 | } 37 | } -------------------------------------------------------------------------------- /src/DoStuff.Website/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevinJump/DoStuffWithUmbraco/56b0bee6379d36f208028881ce098accf139c719/src/DoStuff.Website/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/DoStuff.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoStuff", "DoStuff\DoStuff.csproj", "{11DF40A3-294F-4244-AF64-D8F79EC62F95}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoStuff.Client", "DoStuff.Client\DoStuff.Client.csproj", "{F0A72001-59F1-4DFF-8844-4C629EF97524}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoStuff.Core", "DoStuff.Core\DoStuff.Core.csproj", "{E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoStuff.Website", "DoStuff.Website\DoStuff.Website.csproj", "{090E7952-90C0-482E-8C0F-CBBFE2DED1A1}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|x64 = Debug|x64 18 | Debug|x86 = Debug|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|x64 = Release|x64 21 | Release|x86 = Release|x86 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|x64.ActiveCfg = Debug|Any CPU 27 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|x64.Build.0 = Debug|Any CPU 28 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|x86.ActiveCfg = Debug|Any CPU 29 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Debug|x86.Build.0 = Debug|Any CPU 30 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|x64.ActiveCfg = Release|Any CPU 33 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|x64.Build.0 = Release|Any CPU 34 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|x86.ActiveCfg = Release|Any CPU 35 | {11DF40A3-294F-4244-AF64-D8F79EC62F95}.Release|x86.Build.0 = Release|Any CPU 36 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|x64.ActiveCfg = Debug|Any CPU 39 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|x64.Build.0 = Debug|Any CPU 40 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|x86.ActiveCfg = Debug|Any CPU 41 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Debug|x86.Build.0 = Debug|Any CPU 42 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|x64.ActiveCfg = Release|Any CPU 45 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|x64.Build.0 = Release|Any CPU 46 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|x86.ActiveCfg = Release|Any CPU 47 | {F0A72001-59F1-4DFF-8844-4C629EF97524}.Release|x86.Build.0 = Release|Any CPU 48 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|x64.ActiveCfg = Debug|Any CPU 51 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|x64.Build.0 = Debug|Any CPU 52 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|x86.ActiveCfg = Debug|Any CPU 53 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Debug|x86.Build.0 = Debug|Any CPU 54 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|Any CPU.Build.0 = Release|Any CPU 56 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|x64.ActiveCfg = Release|Any CPU 57 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|x64.Build.0 = Release|Any CPU 58 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|x86.ActiveCfg = Release|Any CPU 59 | {E0064231-09AA-4C68-9E14-3ADC1CFC1B7F}.Release|x86.Build.0 = Release|Any CPU 60 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 61 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU 62 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|x64.ActiveCfg = Debug|Any CPU 63 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|x64.Build.0 = Debug|Any CPU 64 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|x86.ActiveCfg = Debug|Any CPU 65 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Debug|x86.Build.0 = Debug|Any CPU 66 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU 67 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|Any CPU.Build.0 = Release|Any CPU 68 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|x64.ActiveCfg = Release|Any CPU 69 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|x64.Build.0 = Release|Any CPU 70 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|x86.ActiveCfg = Release|Any CPU 71 | {090E7952-90C0-482E-8C0F-CBBFE2DED1A1}.Release|x86.Build.0 = Release|Any CPU 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | EndGlobal 77 | -------------------------------------------------------------------------------- /src/DoStuff/DoStuff.cs: -------------------------------------------------------------------------------- 1 | namespace DoStuff; 2 | 3 | /// 4 | /// this is the 'main' project for our extension, the core and client 5 | /// are included in this project, and then this is project we add to 6 | /// the website. 7 | /// 8 | /// 9 | /// having a core and client, means we can potentially have extensions 10 | /// that only need core (no UI) and they don't have to include any of 11 | /// the client logic. 12 | /// 13 | /// it also means we might have multiple clients (for multiple umbraco 14 | /// client versions) that can all use the same core. 15 | /// 16 | public class DoStuff 17 | { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/DoStuff/DoStuff.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/DoStuff/DoStuffComposer.cs: -------------------------------------------------------------------------------- 1 | using DoStuff.Client.Composers; 2 | using DoStuff.Core; 3 | 4 | using Umbraco.Cms.Core.Composing; 5 | using Umbraco.Cms.Core.DependencyInjection; 6 | 7 | namespace DoStuff; 8 | 9 | public class DoStuffComposer : IComposer 10 | { 11 | public void Compose(IUmbracoBuilder builder) 12 | { 13 | builder.AddDoStuffCore(); 14 | builder.AddDoStuffClient(); 15 | } 16 | } -------------------------------------------------------------------------------- /where/index.md: -------------------------------------------------------------------------------- 1 | # Where Is X ? 🧀 2 | 3 | With the advent of the new backoffice client library, lots has changed and moved in umbraco, here we are attempting to capture that so we can point to you the right place. 4 | --------------------------------------------------------------------------------