Our blog contains the activity stream of Orchard Dojo: general news, new resources or tutorials are announced here.

Featured tags

IIS
API
All tags >

Orchard Core 1.7, customizable user display name and avatar - This week in Orchard (08/09/2023)

We are thrilled to announce that Orchard Core 1.7 is now available! Check out this post to know everything about the latest release of Orchard Core. In the upcoming weeks, we will check out the newest features and additions of Orchard Core 1.7. Let's get started! Orchard Core updates Add GraphQL types to the SEO module The SEO module of Orchard Core provides Search Engine Optimization (SEO) features: Meta description, keywords, robots, and custom meta tags Canonical URL Open Graph metadata Twitter Card Tags Google schema If you enable the SEO module, you can attach the SeoMeta Part to your content type that allows SEO meta descriptions to be applied to a content item. Let's enable this module and attach the SeoMeta Part to our sample Blog Post content type! Now, if we edit the predefined blog post, we will have a SEO tab, where we can provide the SEO-related settings. The issue was all the Seo meta fields should appear in the GraphiQL interface and be queriable. To test out this fix, we have to navigate to Configuration -> GraphiQL and run a query where we want to check out the SEO meta-related fields. Here you can see that we printed the page title, the canonical URL, and the meta description too. Fix the admin UI sort When you import many contents with the same ModifiedUtc, the pager logic will not work correctly and some items will be skipped when trying to paginate. With this fix, we add a sort by ID after the sorted value to ensure no records are skipped due to the identical value. Demos Customizable user display name and avatar We wanted a way to be able to change how the user name is displayed because the user name itself is too technical. We really don't have a way to change the displayed user name, so the CrestApps.Components.Users NuGet package contains a feature called User Display Name, that provides a way to change how the user name is displayed. The other feature of this package, User Avatar, provides a way to display an avatar for each user. Let's add this package to our Orchard site and enable both features under the Configuration -> Features screen! Now if you head to Security -> Users and edit a user, you will find a way to upload an avatar. If you do that and hit Save, you can see your avatar in the top-right corner and in the content items list if you navigate to Content -> Content Items. The other feature is about changing the whole name. First of all, let's navigate to Configuration -> Settings -> User Display Name! Here you can change how you want the name to be displayed using the Display Name Format select list. Here we specified the First Middle and Lastname format but you can say that you want to use a custom format (if the predefined ones are not suitable for your needs) and use Liquid to define your own format. We also say that you have to specify the first name and the last name for every user (if you edit a user, these values will be required) but the middle name is optional. We will not need the display name text box on the user editor, we will generate it using the display name format. If we edit an existing user, we will have the First Name, Middle Name, and Last Name text boxes. If we enter some values inside, you will see that the format of the user name has been changed in the top-right corner (and in the content items list if you navigate to Content -> Content Items) based on the format we have just set up earlier. If you would like to know more about these features along with some technical details and more goodies, head to YouTube for a recording! News from the community Orchard Core 1.7 The community recently released the latest 1.7 version of Orchard Core with several new features and additions! There's a new SMS and SMS Notifications module that provides a way to send SMS messages and notifications to users using SMS services. And by utilizing the new two-factor SMS Method feature, you can also transmit a two-factor authentication code to the user via SMS. And yes, this means that starting with version 1.7, Orchard Core is shipped with everything you need to secure your app with two-factor authentication. The Lucene and Elasticsearch features are capable of searching within PDF files because PDF files are indexed by default. As an enhancement, we added a new feature called Media Indexing which extends the media indexing capability to also encompass searching within files with the following extensions .txt, .md, .docx, and .pptx. And we have a lot more to cover! Here are all the details of the release. Orchard Core is available as a NuGet package which you can easily add to your ASP.NET Core solution. Here’s how you can get started with Orchard Core. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 547 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Support Mail Proxy, open-source Lombiq projects published on NuGet - This week in Orchard (10/03/2022)

Topics for the week are the new mail proxy support, documentation about how to use a local copy of Orchard Core source code as NuGet packages, and the published Lombiq projects on NuGet! Do you want to know more? Then check out our post now! Orchard Core updates Support Mail Proxy Let's say that your web hosting provider doesn't allow outbound connections by default (IONOS Windows Shared). In this case, all outbound connections should be sent through a proxy on this platform. You can configure it for HTTP(S) by adding this in the Startup.cs of the Orchard Core web app: HttpClient.DefaultProxy = new WebProxy("http://winproxy.server.lan:3128"); However, there was no way to configure this for SMTP connections. So there was an issue about not being able to send a mail with Orchard on this hosting provider. But from now you can configure the proxy server and the proxy port number by enabling the OrchardCore.Email module and using the SMTP Settings. The documentation is also updated with these new settings. Using a local copy of Orchard Core source code as NuGet packages There is a new page in the Orchard Core Documentation about how to use a local copy of Orchard Core source code as NuGet packages. In this new article, you can see how to create your own local NuGet feed from your local source code, how to publish to your NuGet feed, and how to update your project to use the newly created feed. News from the community Configure portable object localization in ASP.NET Core There was an ASP.NET Community Standup about localizing the .NET website. There was a topic on how the .NET websites have been localized using the Orchard Core localization package with PO files. Sébastien Ros did a demo about the package, explained how the localizer works, how to inject it, how to use the module, how to create a PO file, how to use pluralization, etc. If you would like to know more about localization and haven't seen that demo yet, check out the recording of that standup meeting here! And in the meantime, now there is a new article on the Microsoft Technical Documentation where you can read more about what is a PO file, how to configure PO file support in ASP.NET Core, or how to create a PO file with several useful examples. Open-source Lombiq projects now published on NuGet We have more than 160 open-source repositories under our GitHub organization, out of which more than 140 are somehow related to Orchard (including Orchard Core and 1.x). Up until now, if you wanted to utilize our projects in your own ones, you could only reference them as Git submodules or copy over the source files. Now, however, all the Orchard Core-related projects of ours, as well as several others, are available as NuGet packages! Check out our blog post to know more about our NuGet packages! Do you want to easily publish your projects to NuGet as well? You can build on what we've created for that: Take a look at our new GitHub Actions project that we developed with the help of Orchard community member Dean Marcussen. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 238 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

How to debug a NuGet-based Orchard Core solution - Orchard Core Nuggets

How 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! First, in Visual Studio be sure to uncheck “Enable Just My Code” under Tools → Options → Debugging → General. Then you can debug almost as usual: If you want to step into Orchard’s code from your own code then just put a breakpoint into your code as usual and hit Step Into (F11). It’ll open the Orchard source and debugging will work as usual. If you want to place a breakpoint anywhere in the Orchard Code that you can’t step into from yours (like a controller action) then do the following: Add a reference to the type anywhere in your own code. E.g. just write ItemController somewhere and import the namespace for OrchardCore.Contents.Controllers.ItemController. Hit Go To Definition (F12) on the type. Now you’re at the decompiled source of the type. This won’t be perfect but at least you’ll be able to place a breakpoint at the beginning of the method or other member you want to debug. Be sure to tick “Allow the source code to be different from the original” under the breakpoint’s settings. Run the app with the debugger attached. Your breakpoint will be hit and then the nice symbol sources will be used, just as when you step into Orchard’s code. Note that with “Enable Just My Code” you’ll also potentially see exceptions from the libraries you use or from .NET, even if they’re swallowed down the line. Depending on your work it might be better to keep the option ticked most of the time. Alternatively, you can also try opening a full Orchard source solution (with the Orchard version closest to what you’re using) and attach it to your own app. This sometimes works too but you can only debug Orchard’s own code in that case, not yours. Did you like this post? It's part of our Orchard Core Nuggets series where we answer common Orchard questions, be it about user-facing features or developer-level issues. Check out the other posts for more such bite-sized Orchard Core tips and let us know if you have another question!