In our post, we show you how you can create a SPA with the new recipe in Orchard Core. We also mention the tab support for admin/content edit for Orchard Core and the updated text field predefined list radio button alignment. Check out our post for more!
On Orchard 1.x
Lombiq had another Orchard issue bug fixing hackathon where the goal was the same: fix as many issues for Orchard 1.x as we can. We made good progress again and fixed several bugs. Let's see some of them!
Adding indexes to CommonPart(Version)Record tables
There are no indexes on CommonPartVersionRecord and CommonPartRecord columns, which can cause performance issues and query timeout with a couple of thousand content items in common scenarios, such as simply displaying the content list at "/Admin/Contents/List". This listing can order items by Created/Modified/Published date, so at least those columns should have an index.
In this PR we added the indexes to CommonPartRecord and CommonPartVersionRecord tables.
Extending automatic Workflows CSS discovery with caching
Using ICacheManager we store the names and paths of the resources used by the activities and now the IResourceManifestProvider hasn't been called on every page load. You can find the corresponding PR here.
Workaround for the Azure blob rename bug
This is a workaround only since the bug is in the AzureStorage SDK. When you rename the folder and the name differs only in casing the file will break - except if you rename it to a temporary name and then rename it again to the target name.
On Orchard Core
Update text field predefined list radio button alignment
When you using the admin to set up the editor of your text field, you can choose to have radio buttons as the type of list editor when selecting the predefined list editor type. Here you can see the editor to set the options for the list.
Unfortunately, the alignment of the radio buttons was not properly shown, but from now you will see a correctly formatted editor.
Improve the documentation of the OpenId module
The OpenId module of Orchard Core has got new features and improved configuration settings from time to time. Now the documentation has been updated with more lines about the way that how is the authorization server feature works.
Tab support for admin/content edit
When you create a driver you can define the placement that is the zone where you want the shapes to be rendered in like in Orchard 1. The validation remains outside the tabs. Let's see how does it work!
First of all, add a new placement.json file to the theme that you use for your admin site. Now we added the placement file to the TheAdmin theme with the following content:
This means that move the TitlePart of every content item to a tab called TabContainsTitle when editing. As per O1 if there are no tabs the editor does not display the tab dialog or wrap the content in a border. In the following screen, you could see the editor of the Landing Page content type (defined by the Agency recipe) with the two tabs.
Styling is an extension of Bootstrap tabs, so works with RTL as well. Also, the tabs could go into a collapse if there are a lot of them.
Orchard Core SPA
Install your site using the Headless CMS site recipe that creates a site with Single Page Application and content management features. Then when you open your site you will face with the following message: "File `index.html` not found. Please check the settings and/or upload your SPA"
When you install your site with this recipe, you enabled the OrchardCore.SpaServices module. The purpose of this module is to serve static content and render a single page application for headless CMS mode. Once you enable the module, a spa directory is created under the site's folder from which the server serves the static files. This is the place to put your application's files. There are two options for bootstrapping, one is to use a static file and the other to define a Layout__SPA template with liquid syntax support.
In the settings page, you can set the name of your static HTML file that you would like to be your home page. If you just simply copy an HTML file here with the given name, Orchard will render it as your home page. So, let's remove the tick from the checkbox near the "Use static HTML file" and create a new template called Layout__SPA. We can use the dashboard to do that if we navigate to the Templates option under the Configuration.
Before creating a template, create a simple content type and a new content item that we can use in our liquid template.
This MyContentType has a TitlePart, AliasPart, AutoroutePart and HtmlBodyPart. Let's see what can we do within our template. For example, let's find this content item by the alias and print the DisplayText of this content item. Note that we have also applied some styling to our template. The mystyle.css file is placed under the spa folder.
Note that the PR for this feature is still open and might change in the future.
Orchard Dojo Newsletter
Now we have 66 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 every time when 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!