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

Featured tags

IIS
API
SMS
SEO
All tags >

CodeMirror improvements, 100th This week in Orchard - This week in Orchard (26/06/2020)

The 100th This week in Orchard is here! In this post you could see a great demo about the CodeMirror improvements, we mention the updated Send Email activity, the new sample in our Orchard Core Training demo module about how to do unit testing, and many more! Thanks for joining us for the 100th time! Orchard Core updates Add Reply-To Header to Workflow EmailTask activity When you send an email to a subscriber and they click Reply, the reply message is typically sent to the email address listed in the From: header. A Reply-To address is identified by inserting the Reply-To header in your email. It is the email address that the reply message is sent when you want the reply to go to an email address that is different than the From: address. If you want to configure the Reply-To header in your EmailTask activity now you can do it! Just add the Send Email task to your workflow and use the updated editor of the activity! Allows ZoneShapes to be overridden If you were trying to override the ContentZone implementation in ZoneShapes.cs to get some different behavior for some tabbed shapes, it won't work, because it was not attributed with [Feature(Application.DefaultFeatureId)]. Just a note here: the [Application.DefaultFeatureId] attribute is used to allow core shapes to be overridden. Demos CodeMirror improvements CodeMirror in Orchard Core was a little bit outdated because it was not updated from quite a long time ago. All the views in Orchard Core have been changed that is using CodeMirror and now there is a new style called codemirror that is registered in the ResourceManifest.cs of the OrchardCore.Resources module. And that's not all, here you can see several other add-ons that are included by default. Here you can see the content of the TextField-CodeMirror.Edit.cshtml file. But let's see in action what can you do with these add-ons! When you are using HTML, you will have auto-close for the tags. If your text is too long, it will wrap the lines and the currently active line is being highlighted. And these features are provided by the newly added CodeMirror plugins. In this GIF you can see a Text Field and an HTML Field. We set the editor option to Code Mirror for the Text Field and Standard for the HTML Field. And as you could saw in the code above, you can turn on or off these features just by setting the values of the editor. If you don't want to have an auto-close tags feature, just simply say autoCloseTags: false. If you want to know more about the CodeMirror improvements, don't forget to check this recording on YouTube! News from the community Unit Testing in the Lombiq Training Demo for Orchard Core We added a new service and tests to it to learn a bit of unit testing! First, we'll create a service that we'll then later test in a test project. This service won't be used anywhere else, it's just an example to be tested. Why a service? Services are where usually most of the complex logic of an Orchard-based web app goes. You can test anything as long as you've written it in a testable way (by, for example, not utilizing hidden dependencies but injecting them all), you can write tests for controllers, drivers, background tasks, you name it. However, we think that unless you're aiming for 100% test coverage it's best to focus your unit and integration testing efforts on services. Then, the rest of the app can further automatically be tested via e.g. UI tests. Check out the service that will be tested here and here come the tests for it! This week in Orchard for the 100th time! We started our This week in Orchard series to inform our readers with the latest news and improvements around Orchard 1.x and Orchard Core. In this series we try to cover the most important features of the CMS and of course from time to time we are looking under the hood and show you the different code changes. But this series is not just for developers. We also want to target the super users of Orchard Core to know and be able to use every feature of it by learning the usage of the admin UI. Last year we started to upload Orchard Core demos in separate videos from the weekly podcasts to be able to find the given feature that you are really interested in as quickly as possible. We have also created a playlist for it on YouTube that contains more than 30 videos for now! And don't forget our Orchard Nuggets series that we have started in December last year! In that series, we answer common Orchard questions, be it about user-facing features or developer-level issues. Check out these posts for bite-sized Orchard tips and let us know if you'd have any questions! We hope that you like our series and find it useful! Thanks for reading us! 4000 stars on GitHub In GitHub, you can star repositories and topics to keep track of projects you find interesting and discover related content in your news feed. Starring a repository also shows appreciation to the repository maintainer for their work. Many of GitHub's repository rankings depend on the number of stars a repository has. And we are proud to present that on June 22, the Orchard Core repository reached 4000 stars and it's still growing! Congratulations on the community! Using the admin UI of Orchard Core - Orchard Core Workshop 3 Last Saturday we did a workshop with 11 attendees about how to use the admin UI of Orchard Core! This Saturday we are gonna show you how to develop a module. Are you looking to get up to speed with Orchard? Check out the workshops' details on the Orchard Core homepage! Orchard Dojo Newsletter Now we have 151 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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 week's Orchard meeting!

Content Picker Menu Item, Kast case study - This week in Orchard (02/05/2020)

Soon you will able to show content items in your menu easily! How? Check our newest This week in Orchard post and read about an amazing demo to see the new Content Picker Menu Item in action! We published a brand new case study this week on our website about the latest Orchard Core site we developed. By reading that study you can see the possibilities that you can easily achieve by using Orchard Core as your CMS! Don't forget to read our whole post for the most interesting news around the community! Orchard Core updates Added ability to restrict widgets within a flow part You can use the FlowPartSettings to give content managers the capability to restrict which widgets are available within the flow editor. If no widgets have been selected then all widgets will be available, as per the current implementation. Let's see it quickly! Set up a site with the Blog recipe and then edit the content type definition of the Page content type. To do that navigate to Content -> Content Definition -> Content Types and choose the Page. Then find the attached parts and hit Edit near the Flow one. Here you can select which content types this flow can contain. Just for the sake of demonstration, we say that the Flow editor of this page can only accept Liquid widgets. Let's see what will happen when we create a new Page! Hit New -> Page and try to add something to the Flow editor. You will see that only the Liquid one will be on the list because in the previous step we only allowed Liquid widgets. So, when you attach a FlowPart now you can decide what content types you want to be able to use in a FlowPart. It can be useful if you create a form page type with a FlowPart for it. You could then decide just to allow for form widgets. Remember: if you don't select anything you will be able to use any type of content type with the Widget stereotype in your editor. Added support for IN (SELECT) SQL statements You can use a custom SQL statement, that is about to parse for the queries module, the one that uses the generic SQL language and that will be translated to any dialect that the CMS supports (PostgreSQL, MySQL, SQLite, Microsoft SQL Server). If you use this language now you can use the select expression inside an in statement. It's also supporting the not in correctly and the like and not like was not working well, so these are also fixed. Check the new InlineData attributes added to the ShouldParseExpression test method to see some examples with the new expression. Fix shape table providers There was an issue with the way you would be able to override a template from your module, override a template for a dependent module. This change will look for shape templates in a module for any first-level dependencies and it's also improving performance because there would be fewer shape templates loaded in the memory. And if you have a feature depending on another feature then it won't be able to override the second level feature, you have to depend on that. It makes sense because you are creating a template for the second level feature, so you can depend on that because you expected that it would be there. Deployment plans search Let's navigate to Configuration -> Import/Export and create one or more deployment plans. Here you can filter the deployment plans and also do bulk actions. To do bulk actions select two or more deployment plans and after that, you will see the Delete option in the Actions dropdown. Content culture picker shape documentation If you navigate to the Content Localization section in the Orchard Core documentation, you may have noticed that there were no Razor example codes. From now the documentation has been improved with Razor examples! Demos Content Picker Menu Item Let's set up a site with the Blog recipe, create a new Page, and call it My brand new page. Then choose the Main Menu option in the admin UI and hit the Add Menu Item button. Here you could see the Available Menu Items modal window with two options: Link Menu Item and Content Picker Menu Item. Let's choose the second one! The Content Picker Menu Item is about having the ability to choose from the content items available in the CMS with a content picker. There is the Selected ContentItem dropdown, that can be used to select the content item that you would like to show on the menu. You can type to search or just simply select your item from the list. We will select our newly created page here. Publish the menu and navigate to the homepage of your site to see your menu. We placed the new menu item after the About, but of course, it's your choice to set the position of your menu item. If you are interested in the full demo don't forget to watch the recording on YouTube! Note that this feature is under development and can be found in this branch! News from the community Orchard Nuggets: How to add a culture URL segment for localization in Orchard Core 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. What do you need to achieve this? In our newest Orchard Nuggets post, we give you the answers! Check out the other posts for more such bite-sized Orchard tips and let us know if you'd have another question! Helping Kast build a multi-tenant platform on Orchard Core Kast is an Australian company and one of their primary goals is to implement the Kast platform with the Kast Group Finder component. We worked together with Seth Cleaver (Co-founder and Director of Kast) on this tool to be able to create an intuitive self-service process that enables people within a church to easily find a suitable group to attend, simplify the administrative processes required for getting people into groups, and provide information to the group co-ordinators that might assist in planning and measuring effectiveness. Check out this case study about how we've developed this multi-tenant social group management platform for churches! If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. Orchard Core Training Demo module: combining ASP.NET Core Options with Orchard Core site settings Our Orchard Core Training Demo module has a new tutorial on combining ASP.NET Core Options with Orchard Core site settings. In the SiteSettingsController you could see how to use the Site Settings to access tenant-level settings and any other custom settings! Orchard Core Training Demo module is a demo Orchard Core module for training purposes guiding you to become an Orchard developer. You can use this module as part of a vanilla Orchard Core source that including the full source code - which is the recommended way. You can use it as part of a solution the uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. The module assumes that you have a good understanding of basic Orchard concepts and that you can get around the Orchard admin area (the official documentation may help you with that). You should also be familiar with how to use Visual Studio and write C#, as well as the concepts of ASP.NET Core MVC. Bug reports, feature requests, and comments are warmly welcome, please do so via GitHub. Feel free to send pull requests too, no matter which source repository you choose for this purpose. Updated Lombiq Technologies logos You may have noticed that we rolled out our updated logo in the last few days. The spirit is the same: The lab flask with which we distill our IT solutions ("lombik" in Hungarian means lab flask :)). So, please welcome it! Orchard Core workshops The contributors of Orchard Core will hold some unique online workshops in the coming months, between May and September 2020. So even with Orchard Harvest postponed due to the coronavirus pandemic we'll get some new learning events. Lombiq's developers will also give two workshops, on using Orchard from the admin UI and on developing a module. Are you looking to get up to speed with Orchard? Check out the workshops' details on the Orchard Core homepage! Orchard Dojo Newsletter Now we have 140 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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 week's Orchard meeting!

ConsoleLog helper, IsSectionDefined method - This week in Orchard (03/01/2020)

Happy new year everyone! There was no meeting this week, but in the first post of 2020, we would like to give you a nice overview of the latest improvements of Orchard Core, including the ConsoleLog helper, updated documentation, the new look and feel of our weekly blog post and newsletter and many more! Orchard Core updates ConsoleLog Razor helper and Liquid filter Sometimes you may struggle to get the correct placement or the available alternates of a shape. From now there is a shape dumper to try and see what was going on. Dean Marcussen adapted the dumper to use the ConsoleLog, so when you dump ZoneHolding, you see the holding zone, then another log with all the items in it, with their alternates (as they are calculated at execution time). Let's say you rewrite the Content-BlogPost.liquid to Content-BlogPost.cshtml. In this case, you can use the ConsoleLog Razor helper in the following way: @Orchard.ConsoleLog((object)Model) Then hit F12 if you are using Google Chrome and check the content of the console. The ConsoleLog extension method can be used to dump data from well-known properties, or objects serializable to JSON to the browser console. But if you prefer Liquid instead of Razor, you can use the console_log Liquid filter that will do the same for you in Liquid! Check out the documentation for more info about these new features! Thanks to this new shape dump feature you can construct your Orchard Core site faster and easier! Register User class as an accessible Liquid member Let's say you want to get the User fields from a Liquid template when you are using the UserCreated event of a Workflow. To do that, it's required to make this class an available one from Liquid. Else the only value accessible is the Workflow.Input.User which returns the username. If you check the content of the UserLiquidTemplateEventHandler class, you will see that the User class has been registered. Handle error while rendering resources When using the ResourcesTagHelper and referencing a non-existing resource, it breaks page rendering with the following error: Error 500 : InvalidOperationException: Could not find a resource of type 'X' named 'Y' with version 'Z'. It should log an error, but not break the rendering. To do not break the rendering, the Process method of the ResourcesTagHelper now catches the exception if any and creates a log entry instead of breaking the rendering. Clarify getting started and update for .NET Core 3 in the documentation The Getting Started page of the documentation is one of the most important parts of the Orchard Core documentation where you can see how you can add the Orchard Core NuGet packages to your .NET Core web application. Now this page got some more details about how to create your empty .NET Core web application, how to use the dev packages of Orchard Core and so on. Cloning removed LocalizationSet When cloning a content item that has a LocalizationSet, a duplicate entry of a language was created. That's because the LocalizationSet was not being cleared when cloning so a duplicate entry would be created for a locale. The fix was to remove the LocalizationSet when cloning in the CloningAsync method of the LocalizationPartHandler. Here you can see that the LocalizationSet of the cloned part will get an empty string value. Added IsSectionDefined method Let's say you are using RenderSection to render a zone in a view and you want to render certain HTML elements before and after rendering the zone, only if the zone is available. First, you can call IsSectionDefined to verify if the zone is present as follows: @if (IsSectionDefined("News")){ <div class="news"> @await RenderSectionAsync("News", required: false) </div>} But it was throwing the following exception. InvalidOperationException: IsSectionDefined invocation in '/Areas/XXX/Views/XXX.cshtml' is invalid. IsSectionDefined can only be called from a layout page. The fix for this issue was to add the IsSectionDefined method to the RazorPage abstract class. News from the community Improving our This week in Orchard newsletter We published our first This week in Orchard post on the 20th of June, 2018 and since then we wrote 75 posts, 76 with this one :). Our goal is with the series is to give you valuable news and demos about the happenings around Orchard and Orchard Core every week. To do it we improve the posts from time to time and from this year we would like to introduce a new pack of changesets. Last month we created a poll on Twitter and asked you: would you like keywords about highlights in the title of This week in Orchard blog posts and newsletter subjects? We had 10 votes and everyone agreed that this would help to search, so from now, we changed the title in this way. And that's not everything about the title. Regarding the current date, we used the following format: mm/dd/yyyy. From this year we will use the following format: dd/mm/yyyy, which is a more international way to represent the date. We also changed the structure of the posts a little bit. Let's see the old way: On Orchard 1.x: contained everything that is related to Orchard 1.x. On Orchard Core: contained everything that is related to Orchard Core like the new features, bug fixes, new websites built with Orchard Core. Demos: this section was inside the On Orchard Core section and contained demos about Orchard Core. If there were demos about Orchard 1.x, the On Orchard 1.x also had this section. On Lombiq: news from Lombiq. And now let's see the structure that we use from this year: On Orchard 1.x: new features and news around Orchard 1.x, but the demos will be in a separate place together with Orchard Core demos. Orchard Core updates: bug fixes, new features of Orchard Core. Demos: here come the demos of Orchard 1.x and Orchard Core. News from the community: new websites, news about the Harvest, blog posts about Orchard Core, news from Lombiq, everything that is not related to the code itself. And if you are subscribed to our newsletter you will see that we created a new template for our emails that looks nicer and easier to read. We hope you will like our improvements! Feel free to contact us and share your thoughts about the current improvements or add your own ideas that could help us to make This week in Orchard better! Orchard Dojo Newsletter Now we have 112 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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!

Diving into the Orchard API - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! This week on Dojo Course we dive into the Orchard API, use some of the build-in services and extending the capabilities of our module to make it even better! Using LazyField<T> to load data lazily so they are only loaded when we really need them. Using Work<T> to load dependencies lazily so they are only resolved when we really need them. Applying the [Admin] attribute for admin-related Getting to know an other Orchard service: IAuthorizer. Creating our own permissions by implementing the IPermissionProvider. Using the ContentManager so we can finally work with content items! Generating ad-hoc shapes and matching them to an actual template. Implementing the IResourceManifestProvider interface for managing static resources. Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Content Part development continued - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! This week on Dojo Course we are giving life to our content part by adding several Orchard-y code pieces to it, though the result is far from being Frankenstein-like. While doing that, we also discover some interesting and useful pieces of the Orchard API. Creating a migration for our Contents feature. Difference between ContentPartRecord and ContentPartVersionRecord: versioning content parts. Making your content part attachable to content types (on the Admin UI). Creating a content type using migrations and attaching parts to it. Creating a handler for our content part to do some plumbing (e.g. StorageFilter). Creating a driver for our content part to cover server-side part of the the user interface interaction. How displaying a shape works, what is DisplayType? Shape templates (also editors) and using Placement. Using InfosetPart to store a part's data in the content item's XML infoset document. This eliminates content part record lazy loading, providing a significant performance gain. The importance of driver shape factories. How to make your content part support importing and exporting? Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Also follow us on Twitter to get notified about the latest Dojo Course news, including when a new tutorial is posted. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Diving into theme development and starting with module development - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! Our fourth Dojo Course tutorial wraps up theme development by explaining shapes and alternates. We also start with module development and write some interesting code that actually works. Shapes are the dynamic objects organized into a tree that defines the layout Exploring this tree of shapes using the Shape Tracer module, a bigger building block is a zone Explaining the relation between the Razor templates and shapes, view engines Overriding active templates: alternates Localizing templates: T-Strings (please ignore the ASPX format :) ) and how they work Exploring the naming conventions of templates for targeting the override The resulting output is affected by OutputCache for unauthenticated users Editing the settings for the Orchard.OutputCache module Adding styles and scripts to your templates, difference between AtHead and AtFoot for scripts Taking a look at the Layout shape template, which is the spine of the final layout Generating a module skeleton with the command line tool and adding it to our custom solution folder Introducing the Orchard Training Demo module, specifically developed to aid you in learning about Orchard development Looking at the basic settings of your module: Module.txt Diving modules into subsets of functionality: features Modules are strongly depending on the MVC paradigm Let's see C: writing our first Controller with an action for a start Let's see V: writing a view that represents the result of our controller actions The first and most basic element of the Orchard API: the [Themed] attribute Getting to know Dependency Injection Using our first Orchard service: IWorkContextAccessor How to debug an Orchard application running with IIS Express Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Do you have some feedback about the course? Please send it in. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Advanced content management and starting with theme development - Dojo Course

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! Forms, tokens, projections? Command line scaffolding for themes and shapes? This is what the third Dojo Course tutorial is about. Continuously updated source code for the Course (you can upload the latest source in a zip from here) Using Custom Forms: Creating a content type for using as a form, with fields Creating a custom form with the newly created content type Using Workflows to run custom activities like sending an e-mail when a form is submitted Using tokens to create dynamic texts Using the Projector module to list content items: Creating queries to define which content items to list, in what order and how to display them Creating Projection Pages or Projection Widgets to display the result of the query Using Query Links in Navigation Starting with developing extensions: themes Using the command line tool, help Command line scaffolding: generating a theme with a separate project and adding it to our custom solution Basic settings for your theme with Theme.txt: Name, BaseTheme (inheritance) Using the Shape Tracing feature to reveal how the layout is built up, notion of shapes Remember: if you have any questions don't hesitate to ask them by creating a new issue in the Orchard issue tracker with the "discussion" label. Make sure to prefix your thread's title with "Dojo Course - "! We keep an eye on these issues. Haven't you enrolled yet? Why not do it some time in the near future like right now?

Forum favourites: model editors with shapes, accessing a shape's generated html and accessing content fields programmatically

Forum topics from the Orchard discussion board that we found interesting: "Passing my own data types to a view": using form field html helpers with dynamic models and in alternates defined with the shape attribute "Dynamically built html with Clay": capturing the generated html coming from a shape "How to access fields of a content item again?": ways of accessing a content field's value by using dynamic or statically typed extension methods