This week in Orchard - 06/14/2019

Gábor Domonkos's avatar
Media Library, Facebook, Documentation, This week in Orchard

In our post you could read a demo about the GraphiQL explorer improvements. But first, check the other new features of the admin site of Orchard Core and the new docs too! Check out our post for more!

On Orchard Core

Add Codemirror Liquid editor to Autoroute Pattern setting

Now when you edit the AutoroutePart using the admin site you have a liquid editor to provide the pattern used to render the custom URL of the content type.

Fix content picker width with breakpoint and making the content items reorderable

If you edit a content type that has a content picker, you will see that now the picker has a correct width when displaying the screen in different sizes.

You can also reorder the picked items by using a simple drag-and-drop. Furthermore, if you hover your mouse over the picked items, you will see the changes of the cursor.

Extend Facebook Documentation

The OrchardCore.Facebook module has finally been merged to the dev branch! It's also got updated documentation about the Facebook Social Plugin Widgets and about what are the available settings when you would like to register a Facebook App with your Orchard Core site.

If you are interested in this module, we have written about it a few weeks ago!

Add documentation for overriding Views

New documentation has been added to the ReadTheDocs page of Orchard Core about how to override existing views that come from modules in your theme.

Add View button to media library items

Now when you navigate to the Assets and select or hover over a media library item, you will see a new view button under each item in order to preview the file and easily copy the URL.


GraphiQL and GraphiQL explorer improvements

Last week we showed the new GraphiQL explorer. Since then, the explorer has got some new features. First of all, it now allows filtering and returning of the localization part data.

Until now we don't currently have a way to expose a list of all the media assets stored in the media library so please welcome the new mediaAssets query to return the available assets. This is useful when using Orchard as a headless CMS with for example Gatsby to statically compile images into the website.

In the screen above you can see a query to list every item from a folder called Backgrounds.

You will notice a new property of every content type, called Render. If you check the box near render and run the query you will get the following result.

The render property of the blog post, in this case, will show you how will a blog post be rendered. This is a full HTML of the page with a title and everything. This is exactly like you would have if you look at the source code of the page in the browser when opening the given blog post. Let's see how does it work!

The assumption was that it should be very easy to render a shape and the way it was done was more complex than necessary. The render property rendering the shape from build display of the content item with any display types. You just need to call the displayHelper.ShapeExecuteAsync! That's all you need to do from a shape to render it. In GraphQL this works in the following way:

using (var sw = new StringWriter())
var htmlContent = await displayHelper.ShapeExecuteAsync(model);
htmlContent.WriteTo(sw, HtmlEncoder.Default);
return sw.ToString();

So just call displayHelper.ShapeExecuteAsync and pass a shape to it to get the IHtmlContent which can be written to a TextWriter!

On Lombiq

Orchard Dojo Newsletter

Now we have 72 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!

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!

No Comments

Add a Comment