orchardcms

Orchard CMS: Conditional CSS Class based on Layer

心不动则不痛 提交于 2019-12-14 04:08:47
问题 I am trying to add a css class if I am in a particular layer. So 2 questions: Is it possible to identify the current layer in a Razor view. Something like: if(currentLayer == "TheHomepage") { ... } Is the the right way to approach HTML conditional on layer, or is there a better way to do this in Orchard? 回答1: If you need to see which layers are currently active, you can do something like this: @using Orchard.Widgets.Services @{ var widgetsService = WorkContext.Resolve<IWidgetsService>(); var

Creating a module for Orchard that stores data from the front-end

痞子三分冷 提交于 2019-12-14 03:48:18
问题 Code will come later as soon as i am in front of my development machine, though hoping in the meantime someone can help.... I am trying to develop on Orchard CMS v1.6.1. At the moment I am in the midst of trying to develop a module that will essentially allow me to place a Newsletter subscription view within the footer (or anywhere else i choose) on the front end. I have followed several tutorials and they all seem to show how to store data from the Admin only - I need to store data on the

User Data in Orchard

折月煮酒 提交于 2019-12-14 02:22:59
问题 is there any flag that determine if a user is active or not in orchard? Because I tried to delete a user in orchard but the record is still exists in tables: xxx_Orchard_Users_UserPartRecord xxx_Orchard_Framework_ContentItemRecord So I'm guessing there's another table that stores this info? Thanks 回答1: Users are content types and Orchard creates content items for each user. When you create a new user Orchard adds records to xxx_Orchard_Users_UserPartRecord, xxx_Orchard_Framework

Orchard CMS: Where new theme structure and files get saved when installed from Gallery

末鹿安然 提交于 2019-12-13 23:25:48
问题 I have a couple of general questions please. Just stepping into Orchard CMS. So apology if they look stupid! Today I installed a theme called Metro from Theme Gallery. It is visible on theme selection page as well. But where the files and folder structure are got saved in Orchard CMS? I looked into Theme folder but it is not there. I want to see how the structure is placed so that I can create one myself One more thing. Theme .png file shows a nice layout but when I activate it the layout

Orchard IRepository vs. Linq to SQL

痴心易碎 提交于 2019-12-13 19:50:45
问题 In Orchard CMS using IRepository<> is quite common. So i ask myself, what is the advantage of using IRepository<> and its Fetch() method instead of simply using Linq to SQL to query data? IRepository<> Repository.Fetch(r => r.ID == 1234).Select(r => r.Name) The disadvantage here is that i have to inject the repository in the constructor. Linq to SQL from r in Repository where r.ID == 1234 select r.Name 回答1: Generally Repositories are an abstraction on top of your data access code. You may

How is the default item controller registered/invoked in Orchard CMS?

蹲街弑〆低调 提交于 2019-12-13 19:42:58
问题 I'm trying to get my head around how multi-tenancy and routing works in Orchard CMS. As I understand when Orchard starts a new shell (tenant) all the active modules for that tenant are loaded and any modules that implement IRouteProvider "publish" their routes. A ShellRoute is then added for each route which will only be matched for requests made to that tenant's hostname/suffix. The request is then handled in the normal way by MVC (looking in RouteTable.Routes for a match). What I can't

Orchard Content Type is null

你说的曾经没有我的故事 提交于 2019-12-13 16:04:30
问题 i am new in orchard module development.i create a module.when i try to save data. i use this code fore save data public ActionResult Create(FormCollection input) { var product = contentManager.New<ProductPart>("Product"); product.EmployeeName = input["EmployeeName"]; product.EmployeeFathersName = input["EmployeeFathersName"]; product.DOB = Convert.ToDateTime(input["DOB"]); product.Email = input["Email"]; product.Address = input["Address"]; product.JoiningDate = Convert.ToDateTime(input[

Dojo/request undefined despite require

北战南征 提交于 2019-12-13 08:49:37
问题 In a script associated with an Orchard view I try to post an AJAX to server with dojo.request.post function. However, I only get esri/request , dojo/request is undefined. I call the request outside the function where the require statements reside, but there's no problem with other required packages as long as I use them in correct format. Dojo/request works in our other project, so I suspect Orchard of messing things up (the other project's dojo/request use is in a plain page, not in a view),

Orchard CMS with windows auth?

∥☆過路亽.° 提交于 2019-12-13 07:38:00
问题 Can Orchard work with AD and Windows authentication? I need to allow only specific AD groups access to a blog. The rest of the site should be accessible to any valid domain user. The admin dashboard should only be accessible by another specific AD group. [ update ] At the suggestion of ViRuSTriNiTy, I tried the following: - install the windowsauth module http://gallery.orchardproject.net/Packages/Orchard.Module.AlexZh.WindowsAuthentication - in the admin settings, I added a user for myself as

Orchard CMS Duplicate Content Error

柔情痞子 提交于 2019-12-13 06:50:55
问题 We have a web site built with Orchard CMS v1.8. We have had a couple of instances where the person that manages content has not been able to save changes to a Page. They receive the following error. An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back Sequence contains more than one matching element System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault