orchardcms

Need help implementing an Orchard CMS Shape Method

℡╲_俬逩灬. 提交于 2019-12-12 02:11:59
问题 I am just learning Orchard CMS and am having trouble implementing a shape method to return some arbitrary text without creating a whole set of model, driver, etc. I am trying to use the code at http://docs.orchardproject.net/Documentation/Accessing-and-rendering-shapes public class DateTimeShapes : IDependency { private readonly IClock _clock; public DateTimeShapes(IClock clock) { _clock = clock; T = NullLocalizer.Instance; } public Localizer T { get; set; } [Shape] public IHtmlString

Suppressing Widget.Wrapper without suppressing Widget.ControlWrapper

爱⌒轻易说出口 提交于 2019-12-12 01:57:19
问题 I have an alternate view for a widget. In that view I'm suppressing the wrapper using code like this: Model.Metadata.Wrappers.Clear(); This works, but I'd like to only suppress the Widget.Wrapper. Right now it is also suppressing the Widget.ControlWrapper which prevents the edit buttons from displaying when I have the Widget Control Wrapper module enabled. Is there any way to clear only the Widget.Wrapper while keeping the Widget.ControlWrapper? 回答1: In case anyone comes across this for a

Item Templates vs Part Templates in Orchard

北战南征 提交于 2019-12-12 00:28:25
问题 I'm learning Orchard and I did some Pluralsight course. It covered Part Templates, but now I'm reading this article: Anatomy of a theme and there's a section called: Item Templates . And I'm confused. I think I haven't came across this notion before. What is the difference? Let's have a sample that I have a content type Movie with content part Movie . I can override how it's rendered using Part Template . So where I would use Item Template in this case? 回答1: Wrote a blog post with a tiny bit

Calling Script.Require in Shape view returned from IResultFilter not working in Orchard CMS?

与世无争的帅哥 提交于 2019-12-11 17:40:11
问题 I'm currently writing my own module that needs some scripts to be loaded on all pages, both on the front-end and the dashboard, where the user is authorized to edit content. I've written an implementation of the IResultFilter that adds a shape to the 'tail' zone in the site's theme. The shape is added to the page correctly and all is OK except for one thing. In the same shape I'm also trying to call Script.Require on a few scripts that I've added to the ResourceManifest, but they're not being

Accessing info from CommonPart is extremely slow?

不想你离开。 提交于 2019-12-11 16:57:21
问题 I'm new to Orchard and this must be something involving how the underlying data is stored. The joining with CommonPart seems fast enough, like this: var items = _contentManager.Query<MyUserPart, MyUserPartRecord>("someTypeName") .ForVersion(VersionOptions.Published) .Join<CommonPartRecord>().List().ToList(); That runs fairly fast. But whenever I try accessing some field in CommonPart , it runs extremely slow like this: var items = _contentManager.Query<MyUserPart, MyUserPartRecord>(

Projection, Queries missing in Orchard 1.4.2

感情迁移 提交于 2019-12-11 16:22:54
问题 I can't see the queries section the dashboard, neither can I see that as a part of Projection Page. Has anything changed? In logs, there is one error : Object reference not set to an instance of an object. at Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver.<>c__DisplayClass5.<Display>b__4() at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClassd.<ContentShape>b__c(BuildShapeContext ctx) in C:\OrchardWebsite\src\Orchard\ContentManagement\Drivers\ContentPartDriver

Delete Orchard CMS content type via command line

左心房为你撑大大i 提交于 2019-12-11 15:39:27
问题 Is there a way via the command line to delete a content type? I created one that seems to be bombing out. Actually the error is: The model item passed into the dictionary is of type 'Contrib.DateTimeField.Settings.DateTimeFieldSettings', but this dictionary requires a model item of type 'Orchard.Fields.Settings.DateTimeFieldSettings'. I just want to delete it and create another content type. Can I do this via the command line? I can't really do it via the admin page because I get the above

Orchard CMS 1.6 placement.info Order not working

喜欢而已 提交于 2019-12-11 15:01:48
问题 I've just migrated a site to 1.6 - form 1.5, and I'm experiencing issues with the placement.info file in my theme, I have the following placement <Match DisplayType="Detail"> <Place Parts_Title="/BeforeMain:1.5"/> </Match> I aslo have a Bred crumb menu widget placed in Before main with a placement setting of 5 No matter what I do to the numeric placement values, the Title always appears before the bread crumbs. I'm also experiencing other issues with the theme placement.info file anybody else

Weird encoding issue in Orchard web pages

大憨熊 提交于 2019-12-11 14:59:12
问题 Lately, I got a really weird bug that it’s even hard to describe. We have a site created with Orchard in 2 servers, the dev server and the production-live server. In the dev server everything works perfectly. In the production server, if you are logged on the CMS, again everything works well. If you are not logged on though, like the actual visitors of the site are, then it’s nearly perfect. The problem is almost random and happens only in 1-2 places in the whole site (different places).

Creating a module which handle other modules

醉酒当歌 提交于 2019-12-11 13:44:07
问题 I just got involved in Orchard, so I apologize for any confusing terms. from what I learned and read you can pretty much customize Orchard to include or exclude anything you want since its a framework in the first place, so features like MVC, modules are really parts of the framework but not it's not essentially based on. is it possible to create a module which interacts with other modules? To make it clear, say we have a module which does something like an API call, fetching data and