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 >

This week in Orchard - 06/14/2019

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. Demos 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!

This week in Orchard - 05/17/2019

In our post, we would like to give you some tips about how to write localizable text in Orchard Core. We check the new User liquid filters, the new Twitter integration and many more! On Orchard Core Add various User liquid filters We already had the User object in liquid and now we have the has_permission filter to check for named permission and optionally a resource to check for. We have the is_in_role filter to check if the user is in the role and the has_claim filter to check if the user has a claim of the specified type. Workflows Internalization This PR has three changes related to localization. First of all, the State text in the OrchardCore.Workflows/Views/Workflow/Details.cshtml file was not translated. The second one is more interesting. In the OrchardCore.Workflows/Views/Workflow/Index.cshtml we render the status of the workflow. The status can be Idle, Starting, Resuming, Finished and so on. This is an enumeration. These will be rendered as is in the output, they were not translated. Translating as you can see here could be fine because it's just a static value. The issue is nobody will be able to translate them because we don't know they have to be translated. The solution, in this case, is to use a switch statement. So, enums should be localized using a switch statement that resolves to calls to T[] with the static string inside it. This way our tool will be able to pick it up and add the entry in pot files. The last point for translation is tricky. It's not a dynamic value (a class) and it can't be solved with a switch. The solution here is to add a new property on the activity to return a localized string, like DisplayText. Add create new option to Publish and Save Draft buttons Now we have a Publish button with one suboption called Publish and continue.This PR extends this and adds a new suboption which is Publish and create new. The Save Draft button will also get a new option to Save Draft and create new. Twitter client and update status workflow activity In this PR, Michael Petrinolis extends Twitter Module with a Twitter API client and an Update Twitter Status workflow task. To use the new Twitter integration and the new Update Twitter Status activity, you need to enable the Twitter Integration module. Now you can navigate to the Twitter Integration page in the admin site, where you need to provide four different settings: API key: The API key defined in the Keys and tokens tab of the Twitter app dashboard. API secret key: The API secret defined in the Keys and tokens tab of the Twitter app dashboard. Access Token: The Access Token defined in the Keys and tokens tab of the Twitter app dashboard. Access Token Secret: The Access Token Secret in the Keys and tokens tab of the Twitter app dashboard. To get these settings, you need to create a new Twitter application where you can get these values. Now you can use the new Update Twitter Status Task. Let's say we would like to post a new tweet when a new blog post has been published to our site. We can use the Content Published Event as a startup task and set the Blog Post content type to filter on. After add the Update Twitter Status Task and provide a title and a template for updating Twitter status. Bethany Christian Services using Orchard Core Bethany Christian Services using Orchard Core for their website. Bethany believes every child deserves to be loved, connected and empowered through the family. Bethany is a global nonprofit that supports children and families with world-class social services, all designed to help families thrive. APS Medical Billing Solutions using Orchard Core APS understands that it takes experience to run a successful healthcare business, and they are dedicated to finding solutions that fit your specific practice requirements. The team of qualified medical billing specialists work with each practice to create value through customized service. 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. On Lombiq Orchard Dojo Newsletter Now we have 61 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!

This week in Orchard - 05/03/2019

The content localization for Orchard Core reached a huge milestone! Don't hesitate to read our post about the newest awesome features of the CMS! On Orchard Core Apply dynamic content type permissions to Admin Menu The dynamic content type permissions are now implemented. In the past they were not supported in the navigation (you clicked on the menu and got a permission error message), now the admin menu reflects the permissions. You can see an example of this in the following GIF. There is a user who logged in with a contributor role. If the admin adds or removes permissions, the admin menu reflects the changes and hides/shows the options in the New, Content Types and List Admin Node menu. Features bulk actions Now you can enable multiple features at the same time. In the past, we had the checkboxes, but we were not taking them into consideration. If you navigate to Configuration -> Modules and open the select list near the Actions, you can see that now you can enable, disable and toggle the features that you have selected using the checkboxes before them. Use Bootstrap modal instead of browser confirm When you have to confirm an action (like Delete), we're using a Bootstrap modal instead of the native browser popup, so it looks nicer. And of course it's also localizable in the following way: <div id="confirmRemoveModalMetadata" data-title="@T["Delete"]" data-message="@T["Are you sure you want to remove this element?"]" data-ok="@T["Ok"]" data-cancel="@T["Cancel"]"></div> This div has data attributes in it (for example title and message) and we localize the text here that we want to include to JavaScript. From JavaScript, we load the element by ID and get its data which is the localized text. You don't inject localization in JavaScript, you inject it in HTML for encoding and security reasons. Orchard Core Translations repository By using this repository, we will automatically get all the localizations from Crowdin. There will be an AppVeyor script, that will automatically list all the localizations from Crowdin and generate a NuGet package for each of the languages and then push it to NuGet. So, the AppVeyor script will download the files, create a package and publish it to NuGet. This package will contain the AppData with the exact structure, so it will contain the pot files for the language. ASP.NET Core - App Building Workshop There was an app building workshop, where developers created something using ASP.NET Core. The demo is about building a conference agenda website. Sébastien did it also in Orchard Core to be sure you can do the same thing in Orchard. In our documentation, we have a Guides section and there is a tutorial called Building a Website from a Web Template (TBD). With the help of this conference, we could write this section soon. RTL support for TheAdmin theme The latest issue was to merge this PR was to do not manage two different files and then to have some condition in the theme to check the current culture and then switch between the CSS files. The goal is to have only one single CSS file and thanks to Hisham Bin Ateya this PR now merged. Demos Content localization If you would like to make your content items localizable you have to enable the Content Localization module. Then you can head to the Configuration -> Settings -> General page and hit the Add or remove supported cultures for the site link and add supported cultures for the site. Let's add some cultures! Now you have an enabled Content Localization module and added some supported cultures to your site. Time to do some content localization! By enabling the Content Localization module, you can attach a new content part, called Localization to the content type that you would like to localize. Let's edit the Blog Post content definition and add the Localization part to it! When you install your site using the Blog recipe, you have one predefined blog post. If you would like to edit your blog post, you will get the following screen. You will notice that you cannot add a new localized instance of your content item until you do not save the existing one. By saving a content item that exists before, you will create the localized version of the content item, in our case the Hungarian version will be created, because this is the default culture of our site. After saving the content item you will notice that the editor has changed. The list of the cultures this site supports appears with a little plus sign before each culture. By clicking one of the plus signs, a new localized version of the content will create, keeping the content of the item. If you navigate back to Blog, you will see a little badge icon under each blog post showing the culture of the content item. Notice the new Localizations button. By clicking on it, you can create a new localized version of the content item or edit an existing one. Now if you edit the Hungarian version of this blog post, you will see the changed icon before the Qafar. That's because a content item with that culture already exists and by selecting the Qafar version, you can edit the existing content item instead of creating a new one. Thanks to JP Tissot, this feature will be merged to dev soon and with this PR, we will reach a huge milestone towards supporting localization in Orchard Core! On Lombiq Orchard Dojo Newsletter Now we have 59 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!