umbraco

Umbraco - How can I get Publish at/Remove at date using C#

旧城冷巷雨未停 提交于 2020-01-15 03:26:09
问题 How can I get Publish at/Remove at date using C# in Umbraco? 回答1: You just need to access the ReleaseDate and ExpireDate of the Document object. var doc = new Document(nodeId); var publishAt = doc.ReleaseDate; var removeAt = doc.ExpireDate; 回答2: Your post helped me a lot. Thank you! I'm a novice on Umbraco, and I have a little comment. To get it to work we need to import the businesslogic namespace: @using umbraco.cms.businesslogic.web; It would be obvious for experienced users, but can be

Umbraco razor template - Get Formatted Date From Field specified in parameter

こ雲淡風輕ζ 提交于 2020-01-14 19:30:49
问题 I'm trying to return a formatted date from a razor template in umbraco. I'm not sure how to get a value from a field defined in a parameter though. Here is the code I'm playing with. The field I'm passing in is called "articleDate". I'm getting the parameter value output, however when I try to get the value of the field using the parameter name it returns nothing. If I ask for the value by the field name itself, that works. How can I create a generic macro like this? @{var param = @Parameter

Session timeout after some seconds in Umbraco

不羁的心 提交于 2020-01-13 10:58:08
问题 I have created an site on Umbraco 7.1.6 it was working perfect in Visual studio 2012; when I deployed it to my hosting space I found a problem that it redirects me to login screen again and again just after some seconds. I have set keep user login to true and increased timeout but no improvement. When I searched for that problem I found some links: https://github.com/umbraco/Umbraco-CMS/compare/release-7.1.6...7.2.0 http://issues.umbraco.org/issue/U4-3845 https://github.com/Umbraco/Umbraco

Avoid deleting folder on Web Publish

Deadly 提交于 2020-01-12 04:07:09
问题 I'm deploying my application to an Azure Website. I've configured the Publishing Profile succesfuly and setup tfspreview.com to publish automatically using continuous integration on each code commit. I have a folder on the path "/media". This folder has pictures and documents uploaded through the CMS (umbraco). This folder gets deleted on each web deploy. From this answer, I learned how to add a SkipDelete rule on either the .csproj or on the wpp.targets file, but everytime I publish the site

ASP.NET Login/Membership - How to logout?

余生长醉 提交于 2020-01-10 20:06:09
问题 I am using the <asp:LoginStatus> control (along with <asp:Login> ) I login successfully as A . Then I logout. If I then login as B , the current user is still A . (Both <asp:LoginName> and HttpContext.Current.User.Identity.Name are showing A ) I have to clear the cookies to completely logout. Why doesn't the .NET login control log me out properly? Anyone has any idea? EDIT : I apologize everyone! This is an Umbraco bug . I forgot I was using UmbracoMembershipProvider 回答1: On logout to

XSLT for-each loop, filter based on variable

风格不统一 提交于 2020-01-07 05:24:14
问题 I have the following XSLT <xsl:param name="productsId" select="/macro/productsId" /> <xsl:param name="type" select="/macro/type" /> <!-- value1, value2, value3 --> <xsl:template match="/"> <xsl:if test="$productsId > 0"> <xsl:variable name="products" select="umbraco.library:GetXmlNodeById($productsId)" /> <div id="carousel-wrap"> <ul id="carousel"> <xsl:for-each select="$products/Product [select only Product with attribute value1, value2 or value3 based on /macro/type]"> <li id="p-{@id}">

On submit click getting issue in umbraco

女生的网名这么多〃 提交于 2020-01-07 02:45:06
问题 I have one submit click on which the comment get submitted for particular product or thing but on clicking that I am not able to submit that commnet and facing issue as seen in below images Another thing is that this things are working properly in my local host but when I upload it on my beta/staging/Live server I am facing this issue. I have also tried deleting umbraco.config file and log file but still facing same issue Also on log file I can see the issue as I have one issue for what i

umbraco API: trying to get the document type data for a given site node

和自甴很熟 提交于 2020-01-06 19:42:06
问题 Just trying to get some perspective about how to retrieve data from umbraco via the API method. I believe we are using umbraco 4.9.x. Basically there is a data type called DiaryEventItems, and I use the following code to access this: // Get the ID of the data type DocumentType DocTypeDiaryEvents = DocumentType.GetByAlias("DiaryEventItems"); // Loop through those items using a foreach at present foreach (Document DiaryEvent in Document.GetDocumentsOfDocumentType(DocTypeDiaryEvents.Id)) { // Do

Create NestedContent Items In SurfaceController

空扰寡人 提交于 2020-01-06 03:29:23
问题 I have two document types: FormSubmission FormField The Form document type has a property named Fields which is a Nested Content data type that contains a list of FormField document types. I am trying to programmatically (in a SurfaceController) create a FormField and add it to the Fields property of the Form document type. Here is the code I am trying to use to do this: var newFormFields = new List<Umbraco.Core.Models.IContent>(); int i = 0; foreach (var formField in model.Fields) { string

Stop Umbraco/TinyMce from converting absolute URLs to relative URLs

老子叫甜甜 提交于 2020-01-05 15:46:07
问题 Both Umbraco/TinyMce both like to strip the base domain from any absolute URLs in the editor. This is problematic as I have an RSS feed that scrapes my posts, and emails them weekly to subscribers. The issue is, images (and links, but I'll worry about that later) obviously won't work if their URL is relative. So far I've done the following: 1) Added to tiny_mce_src.js: convert_urls : false, relative_urls : false, remove_script_host : false, Contrary to what's out there, for Umbraco convert