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

Featured tags

IIS
API
All tags >

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 - 04/26/2019

There was no Orchard Podcast this week, but we have lots of news around Orchard Core and new PRs that will be added to Orchard Core soon! On Orchard Core The Arabic translation for Orchard Core is ready A few weeks ago Hisham Bin Ateya and Abdullah Salem have started to work on the Arabic translation for Orchard Core. Thanks to their hard work, the Arabic translation is now ready! This is the second language that has been completed after the French language, which is the main language for many of the core team. Now it's time to test those translations! Order TimeZone list by name When you would like to set the default time zone for your site under Configuration -> Settings -> General you had to select the preferred timezone from a list that wasn't ordered. Now thanks to this PR you can set the value of the time zone using a list that contains ordered values. New user created event and assign user to role task to workflows Soon you can use two brand new activities when constructing your workflows in Orchard Core. The first one called User created, which is surprisingly fired when a user created. The second one is about assigning a role to a user. Let's say we attached this task after the user created event. In this case, when you edit this task, you can say that assign the Authenticated role for the user that has been created just now. In the following workflow, we do the following and show success or failed notification just for demonstration purposes. GitHub authentication Thanks to Michael Petrinolis when this PR will be merge, you can authenticate yourself in Orchard Core using GitHub, by adding this provider to the list of supported external providers soon. Let's see how this feature will work! First, you need to create a new GitHub App. To do that, head to the GitHub Apps page in the Developer settings and hit New GitHub App. Here you need to provide the name of your GitHub app, the full URL to your GitHub App's website and a user authorization callback URL. Don't forget to generate a private key. After you will get a Client ID and a Client secret. You will need them in the next step. Now you can navigate to Orchard Core admin site and enable the Github Authentication feature. After that, you can notice the Github Authentication option under Github in the menubar. Copy your values here and hit save. Now let's open a new incognito window and navigate to the admin page. Here you can see the GitHub, as another service to log in. Provide the username and the password of a GitHub account to sign in. Now Orchard Core asks you to create a new account based on the user information you have just provided in the previous step. If you click on Register your user account will be created in Orchard Core and you will be able to log in using your newly created account. For note, let's see what happens if a user tries to login with an external provider, and registration is enabled: If the external provider provides an email claim, we search for an existing account with that email. If not found, a new OC Account is created based on the username, email, and password provided by the user. If found, we request the password of the OC Account in order to link the external login. There is a PR that takes into consideration the email must confirmed parameter, if we request a password in order to create a local Account from external login, and also uses the ReCaptcha. There is a front page (OrchardCore.Users/Account/ExternalLogins) where you can link/unlink OC account with external providers. Of course, is not complete, we must decide how this is integrated with profile/account info in admin/front end. Regarding the GitHub, you must select to use your email in public and select which one of the verified emails will be included in the claims. External Login registration without password As you noticed in the previous section when you create a new account using an external login provider you have to provide a password to create the user account in Orchard Core. There is a PR to add a setting to register external users without requesting a local password. In this PR, Michael Petrinolis also implements the way to generate a username instead of parsing claims from external login info and to integrate ReCaptcha in External Login Registration. Facebook module OrchardCore.Facebook provides the following features: Core Components Facebook Login First, you need to enable the Users Registrations module and put a tick in the Users can create new accounts on the site checkbox under Configuration -> Settings -> Registration, because we will create a new user account based on the details provided in the Facebook log in page. To register the Facebook App with the site you need to provide the following settings: AppId: Facebook application id. AppSecret: The application secret. Both settings are available in the Facebook for developers application's page, under Basic Settings. Now enable the Facebook Login module and add these values to Orchard Core. The configuration can be set through the Configuration -> Facebook -> Application menu in the admin dashboard. Now you can log in in your site using a Facebook account, where you can get a familiar screen. After that, you can create your new account in Orchard Core that you can use to log in to Orchard. But the PR is not just about authenticating users from Facebook. If you head to the modules, you will find a feature called Facebook Social Plugins Widgets. Let's enable it! Let's say you installed your site using the Blog recipe. In this case, you have a Page content type with a FlowPart attached to it. Create a new Page and hit on the Add Widget button. Here you will see several new widgets that you can attach to your content type that has a FlowPart attached, like Facebook Comments, Facebook Share, Facebook Like and many more. If you publish or preview your page you will see that the widgets are displayed in your page. On Lombiq Orchard Dojo Newsletter Now we have 57 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!

Forum favourites: multi-node Orchard, community features and low-level data access

Forum topics from the Orchard discussion board that we found interesting: Running Orchard on two nodes: this is a tricky thing but in this discussion there some good tips Community features in Orchard: a lot of built-in and third-party modules bring "social" functionality to Orchard. You won't be able to just install Contrib.Facebook but there are some decent fundamentals. A tale of database table locking, transactions and low-level data access in Orchard: sometimes you just have to bury deeper.