Contents with the Orchard Nuggets Tag Node
-
How to debug a NuGet-based Orchard Core solution - Orchard Nuggets
Orchard Nuggets, Orchard Core, NuGet, DebuggingHow can you debug Orchard Core code when you’re working with a solution that loads Orchard packages from NuGet? Orchard’s packages are built with symbols so you can actually use them as source too!
-
How to access services from another tenant in Orchard Core - Orchard Nuggets
Multi-tenancy, Orchard Nuggets, Orchard Core, OpenAPI, Swagger, Taxonomy Localization - This week in Orchard (12/06/2020)The multi-tenancy feature of Orchard Core is great: A tenant is basically a subsite with its own independent content and configuration, under its own domain or URL prefix. You can use tenants to e.g. host websites for multiple customers of yours from a single Orchard Core app. The sites won't know anything about each other but they'll run from the same app built from the same codebase, and have access to the same modules and themes. This makes maintaining such sites very efficient, both for hosting and for development.
What if you want tenants to be not that isolated though? What if there is certain content or configuration that you actually want to share among tenants or some functionality that you want to centralize on one tenant? You can use the APIs we show below to cross tenant boundaries and use any service from another tenant!
-
How can I call an external API from a workflow task? - Orchard Nuggets
Orchard Nuggets, WorkflowsYou have several options to send an HTTP request to an external API in Orchard Core, but maybe you haven't tried the Http Request Task. Let's see quickly how you can hook up a workflow!
-
How to fix "InvalidDataException: Form value count limit 1024 exceeded." in Orchard Core - Orchard Nuggets
Orchard Nuggets, Orchard Core, ASP.NET Core, Exception, Flow PartLet's suppose you're building your shiny new Orchard Core website. In there you're also building a shiny new page, with Flow Part obviously. You throw together a lot of widgets to get all the bells and whistles on the page, then you save it and BAM! Internal Server Error: "InvalidDataException: Form value count limit 1024 exceeded." What's this, did I break Orchard? Is Orchard trying to break me? Let's fix this!
-
How to add a breadcrumb menu in Orchard Core - Orchard Nuggets
Navigation, Orchard Nuggets, Orchard Core, BreadcrumbsA breadcrumb menu is a simple but effective navigation aid that shows the user where they are in the site's content structure and which path they can take back. It's also part of the web accessibility guidelines. However, there's no feature built into Orchard Core for this. Nevertheless, how to create a breadcrumb menu?
-
How to add a culture URL segment for localization in Orchard Core - Orchard Nuggets
Localization, Orchard Nuggets, Orchard Core, ASP.NET Core, Content Picker Menu Item, Kast case study - This week in Orchard (02/05/2020)So you're building a localized Orchard Core site and want all URLs to be in the form of /culture-name/rest/of/the/url, e.g. /hu-HU/my-page. (Figure out what "hu-HU" is! Hint: It's not an owl, neither a rock band from Mongolia!) What do you need to achieve this?
-
How to add a favicon under /favicon.ico in Orchard Core - Orchard Nuggets
Orchard Nuggets, Orchard Core, Favicon, ASP.NET Core, Click to deploy improvements, autoroute container routing - This week in Orchard (24/04/2020)Every website needs a favicon of course and you can easily add one to your Orchard Core site from a theme or module with a
link
tag in a template. However, there's a catch: Certain browsers will still search for it (as a first attempt) under the path /favicon.ico. This can be a tiny bit detrimental to the client-side performance, and show up as annoying errors in your logs. So what can you do to serve a favicon under that path too? -
4 ways to display something from your module nested within a page in Orchard Core - Orchard Nuggets
Development, Orchard Nuggets, Module, Widget, Liquid, Click to deploy, Update Content Workflow Task - This week in Orchard (17/04/2020)A common question during Orchard Core development, something that came up again recently, is how to display something within the context of an Orchard page when that piece of data comes from your module? How can you "inject" something into the Orchard layout when you want to display e.g. a list of products retrieved from an external API? There are a couple of ways to do this depending on what exactly you need. All are fairly straightforward so let's see a quick rundown!
-
How to debug an MSBuild build process when building Orchard Core - Orchard Nuggets
Orchard Nuggets, MSBuildBuild processes of .NET Core apps like Orchard Core are getting quite complex nowadays, and the MSBuild build pipeline also commonly includes steps for building client-side resources or doing a lot of things out of the .NET world. What can you do if something goes off course with all those targets and props files and you're just scratching your head? How to figure out what happens during the build if you can only see that the results are incorrect?
-
How to publish an Orchard Core app - Orchard Nuggets
Orchard Nuggets, Publishing, Orchard CoreLet's imagine you've already created an Orchard Core app and now it's time to show it to the world. How do you publish it, or rather, how do you create its publish package?
-
How to localize content items? - Orchard Nuggets
Localization, Orchard Nuggets, Culture picker on the Setup page, CodeMirror editor for TextField - This week in Orchard (28/03/2020)So you want to create an Orchard Core website that presents its content in multiple languages. There are many parts of this, but what about content items? How do you make them ready for localization?
-
How to use Orchard Core without the sample themes? - Orchard Nuggets
Orchard Nuggets, Theme, Scoped Liquid TemplateContext, Template Azure Blob with Liquid - This week in Orchard (10/01/2020)Try to reference the
OrchardCore.Application.Cms.Core.Targets
NuGet package instead of theOrchardCore.Application.Cms.Targets
in your ASP.NET Core web application, that will only add the TheAdmin theme to your solution. -
How to use the same version of Orchard Core NuGet packages in every project across my solution? - Orchard Nuggets
Update, Orchard Nuggets, Theme, ModuleYou have your own ASP.NET Core project that using Orchard Core NuGet packages, but every time when you update them you have to do it one-by-one across the whole solution? Wouldn't it be easier to just update the package versions in one place? Then you may need to have a Directory.Build.targets file to define the versions!
-
Why is my content part not recognized in Orchard Core? - Orchard Nuggets
Orchard Nuggets, Content field, Content partYou have implemented your
MyAwesomePart
but you cannot attach it to your content type using the dashboard because it's not showing in the Content Parts list (Content -> Content Definition -> Content Parts)?
The most possible reason for this that you haven't registered your implementation in the service container. To register your class in the service container head to the Startup.cs file of your module and in theConfigureServices
method add the following line:services.AddSingleton<ContentPart, MyAwesomePart>();
But if you are using the RC1 version of Orchard Core or newer you can use theAddContentPart
extension method, where you just only need to provide your content part:services.AddContentPart<MyAwesomePart>();
. TheAddContentPart
and theAddContentField
(that you can use to register your fields) can be found in the OrchardCore.ContentManagement namespace.
Another recommendation is to use the Part suffix when naming your class or cs file that contains your custom part. Don't forget to put it in a Models folder to follow the recommendation of the MVC (model-view-controller) software design pattern.
For more information about registering your Part check out the Startup.cs file of our Orchard Core Training Demo module, where we registered thePersonPart
in the service container. We also mentioned the new way of registering ContentParts and ContentFields in this post of our This week in Orchard series.