orchardcms

Creating a navigation menu item in Orchard

旧街凉风 提交于 2020-01-16 04:22:06
问题 I have written an Orchard Module and would like an item to appear in a Navigation list when the module is Enabled. Ideally, I would like to be able to remove the item when the Module is disabled. Where should I hook into to for when the module is enabled and disabled? How do I programmatically add a menu item to an already existing Navigation? 回答1: You can implement the IMenuProvider interface for this. An example implementation might look something like this: namespace Orchard.Bar { public

How to filter related Content Parts within a Orchard CMS Query

感情迁移 提交于 2020-01-15 12:33:17
问题 Goal: I have a widget that attempts to return blog posts that have matching tags to the current item. Problem: So I have acquired the current ContentItem in my widget and I have returned the TagsPart of that ContentItem: var itemTagsPart = _contentManager.Get<TagsPart>(currentContentItem.Id); And I am now trying to create a query to return blog posts that have a tag record with a matching TagName. var blogs = _contentManager.Query(VersionOptions.Published, "BlogPost") .Join<TagsPartRecord>()

How to filter related Content Parts within a Orchard CMS Query

僤鯓⒐⒋嵵緔 提交于 2020-01-15 12:33:16
问题 Goal: I have a widget that attempts to return blog posts that have matching tags to the current item. Problem: So I have acquired the current ContentItem in my widget and I have returned the TagsPart of that ContentItem: var itemTagsPart = _contentManager.Get<TagsPart>(currentContentItem.Id); And I am now trying to create a query to return blog posts that have a tag record with a matching TagName. var blogs = _contentManager.Query(VersionOptions.Published, "BlogPost") .Join<TagsPartRecord>()

How to filter related Content Parts within a Orchard CMS Query

落爺英雄遲暮 提交于 2020-01-15 12:33:12
问题 Goal: I have a widget that attempts to return blog posts that have matching tags to the current item. Problem: So I have acquired the current ContentItem in my widget and I have returned the TagsPart of that ContentItem: var itemTagsPart = _contentManager.Get<TagsPart>(currentContentItem.Id); And I am now trying to create a query to return blog posts that have a tag record with a matching TagName. var blogs = _contentManager.Query(VersionOptions.Published, "BlogPost") .Join<TagsPartRecord>()

How do we check whether a dynamic clay object has a property?

烂漫一生 提交于 2020-01-15 05:53:09
问题 I have a dynamic object, that I think is implemented with Clay . It has one of two possible property names. I want to use which ever property name is available. The following doesn't work: dynamic workItemPart = item.WorkItem; // is an Orchard.ContentManagement.ContentPart var learnMore = workItemPart.LearnMore ?? workItemPart.LearnMoreField; It throws a Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : does not contain a definition for 'LearnMore' How do we check if a dynamic Clay

Fetching results from more than one IRepository

纵饮孤独 提交于 2020-01-15 05:24:13
问题 I have a list of Users and Orders. public class UserRecord { public virtual int UserId { get; set; } public virtual string Name { get; set; } } public class OrderRecord { public virtual int UserId { get; set; } public virtual int OrderId { get; set; } } I have two repositories - IRepository and IRepository. How can I join the two and fetch the result, like this? SELECT UserRecord.UserId, Name, OrderId FROM UserRecord, OrderRecord WHERE UserRecord.UserId = OrderRecord.UserId Thanks. 回答1: Use

How do I integrate Orchard CMS with a current MVC2 application?

不打扰是莪最后的温柔 提交于 2020-01-14 14:01:50
问题 For my project, the client has an existing ASP.NET MVC 2 web application that has a product catalog and shopping cart functionality. The client is redesigning their website and would like to use Orchard so that they can maintain their content pages such as home, about, services, etc. They would like to use as much of the existing code as possible and keep the shopping cart functionality in place, with just cosmetic changes. Being very new to Orchard (i have only been reading up on it and

How do I integrate Orchard CMS with a current MVC2 application?

瘦欲@ 提交于 2020-01-14 14:01:27
问题 For my project, the client has an existing ASP.NET MVC 2 web application that has a product catalog and shopping cart functionality. The client is redesigning their website and would like to use Orchard so that they can maintain their content pages such as home, about, services, etc. They would like to use as much of the existing code as possible and keep the shopping cart functionality in place, with just cosmetic changes. Being very new to Orchard (i have only been reading up on it and

Boolean Tokens in Orchard CMS

♀尐吖头ヾ 提交于 2020-01-14 13:16:12
问题 Let say I have a Contact Us form in Orchard CMS that I have created that had the following fields Name: Email Address: Message: Newsletter: Now upon submitting this form I have it set to email a specific email address and I'm using the Tokens for the four fields to build the email so that the email received might look like this. Name: John Smith Email Address: jsmith@example.com Message: Hi! I love your site and I hope you get some more content that I can use in the future! Newsletter: True

ImageResizer.net with Cache Plugin causing duplicate output cache

强颜欢笑 提交于 2020-01-07 02:44:12
问题 I have a strange issue, whereby when I enable output caching in Orchard CMS and have ImageResizer.net cache plugin enabled, I get duplicated page content (full DOM). Just for reference, I am deploying to Azure Small Reserved instance. Any ideas how to resolve this - do I need to create a cache profile for output cache not to cache images as this is taken care of by the cache plugin? Thanks in advance, Peter Diagnostic information: Image resizer diagnostic sheet 2/13/2013 9:07:32 PM 1 Issues