orchardcms

Convert DateTime field token to local time zone in email rule

早过忘川 提交于 2019-12-11 01:57:17
问题 Within Orchard I have a custom content type that includes a DateTime field. I've created a rule to send an email when a new content item is submitted. I'm able to include the value of the DateTime field in the email using the following token: {Content.Fields.MyContentType.MyDateTimeField} The problem I'm running into is that the date/time value that replaces the token is in UTC and I need it to be in the timezone configured for my Orchard instance. I see there's a token for the current date

“Cannot create an instance of an Interface” (an MvC 3 Wizard inside Orchard CMS)

泄露秘密 提交于 2019-12-11 01:45:52
问题 Based on the great answer at multi-step registration process issues in asp.net mvc (splitted viewmodels, single model), I used the example Darin Dimitrov provided to test out an ASP.net MVC3 wizard. It works standalone, but not inside Orchard CMS v1.3. I am getting the following error: Server Error in '/' Application. Cannot create an instance of an interface. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more

Orchard CMS - Extending Users with Fields - exposing values in Blog Post

只谈情不闲聊 提交于 2019-12-11 00:28:32
问题 I'd like to extend the users content definition to include a short bio and picture that can be viewed on every blog post of an existing blog. I'm unsure of what the best method to do this is. I have tried extending the User content type with those fields, but I can't seem to see them in the Model using the shape tracing tool on the front end. Is there a way to pass through fields on the User shape in a blog post? If so, what is the best way to do it? 回答1: I also have done this a lot, and

Orchard CMS 1.5 Navigation sub menus

╄→гoц情女王★ 提交于 2019-12-10 21:37:30
问题 New to Orchard. I have been looking for some documentation on how the menus actually work. It appears that you can have hierarchical menus, but I cannot find any good information on this. 回答1: Yes, you can. Since 1.5 you can create hierarchical menus from Navigation admin screen. Hierarchy (and reordering) of items can easily be created by drag & drop. Navigation screen is used to define your menus. In order to display a defined menu you need to put Menu Widget in the zone of your choice.

What does the “check in memory” mean in Orchard CMS?

て烟熏妆下的殇ゞ 提交于 2019-12-10 20:09:27
问题 I tried to customize the queries executed by Orchard.ContentManagement.DefaultContentManager but the following peace of code *1 render my efforts useless: class DefaultContentManager { ... public virtual ContentItem Get(int id, VersionOptions options, QueryHints hints) { ... // implemention of the query comes here ... *1 -> // no record means content item is not in db if (versionRecord == null) { // check in memory var record = _contentItemRepository.Get(id); if (record == null) { return null

Generate Orchard CMS Autoroutes based on hierarchical menu

烂漫一生 提交于 2019-12-10 19:49:30
问题 I have a set of custom content type pages in Orchard that are set up in an advanced menu like so: Title: Parent Page Position: 1 Title: Child Page Position: 1.1 Title: Grandchild Page Position: 1.1.1 Right now each has a URL that reflects the name (eg., /parent-page, /child-page, /grandchild-page). How can I get the URLs for my custom content types to generate hierarchical urls (eg., /parent-page, /parent-page/child-page, /parent-page/child-page/grandchild-page) automatically? -Carson 回答1: If

Create an Alias from the Recipe in Orchard

烈酒焚心 提交于 2019-12-10 18:36:17
问题 I want to create the following Alias from the recipe. How is this achieved? 回答1: I have created this class to add a command for Orchard to create a new alias from command line or recipe: using Orchard; using Orchard.Alias; using Orchard.Commands; using System; using Orchard.Environment; using System.Linq; namespace Contrib.Foundation.Common.Commands { public class AliasCommands : DefaultOrchardCommandHandler { private readonly Work<WorkContext> _workContext; private readonly IAliasService

Orchard Navigation - how to make menu link not clickable

夙愿已清 提交于 2019-12-10 17:25:23
问题 I have following menu navigation: home product product 1 product 2 news press releases about us Every menu item above links to a Content, except "product".I need to make it so when the user click "product" would not go anywhere. I tried to use "Custom Link", and enters "#" or "javascript:void(0)" in the url, however that does not work since Orchard always prefix the url with "/". Also, I tried to use "Html Menu Item" and enter "product" in the html body, but always rendered as <li><span class

Orchard CMS 1.4: Adding a Text Field to Custom ContentPart

自闭症网瘾萝莉.ら 提交于 2019-12-10 16:48:24
问题 In the module for a custom ContentPart, how do I set a field to be a Text field? In my migrations.cs class, I have created the table for the part: public int UpdateFrom1() { SchemaBuilder.CreateTable("RightContentPartRecord", table => table.ContentPartRecord() .Column<string>("Html")); return 2; } So, I have a column called Html. I want to use the WYSIWYG editor, so I am told I need a Text field to get this to work "out of the box". However, this isn't happening for me, so what do I need to

Orchard CMS: Sign Out (Log Off) Confirmation Page

霸气de小男生 提交于 2019-12-10 15:17:29
问题 Is there an event that gets fired when a user logs off of the front end and how can I use that event to redirect the user to a particular view or page? I would like the user to receive a message that says, "You have successfully logged off" after they sign out. 回答1: As always, there is more than one way to do this with Orchard :) Method 1: Overriding the user shape When you log off, you are redirected to an action method on Orchard.Users.AccountController called LogOff , which takes a