Quantcast
Channel: Optimizely Search & Navigation
Viewing all 6894 articles
Browse latest View live

Extending LinkItem

$
0
0

I have created a derived LinkItem class in order to extend it and add additional properties.  I extended LinkItemCollection, and my custom property displays in the editor view of the page and the built-in LinkItemCollection control is displayed, but none of my custom LinkItem derived Properties are available in the editor.  

I took Jon Jones post http://jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-properties/episerver-how-to-render-a-list-of-objects-in-a-page-or-block-propertylist-explained

and adapted it to create a collection of LintItemCollections (yes a collection of collections of Links). This allows the editor to build any number of linkcollections on their page. I then wanted to extend the LinkItem to add additional properties to determine how the link would render. I successfully subclassed LinkItem and LinkItemCollection and have a class that derives from PropertyList that is a collection of my derived LinkItemCollection, and all this renders in the editor view of the page, BUT my custom properties in my derived LinkItem class do not display in the editor. My custom properties in the derived LinkItemCollection appear, but then when you edit an individual link, it displays the original built-in LinkItem Editor without my custom derived LinkItem Properties. Any ideas?


Getting directory from PageFiles folder of EPiServer

$
0
0

I'm having some thoughts about how the EPiServer PageFiles system work. When I get a global file it's simple to get the correct directory, I just write:

var dir =VirtualPathHandler.Instance.GetDirectory("~/Global/myfolder/",true)

But when I want to get files from the PageFiles folder it gets tricky for me. The path in the EPi backoffice upload says it is PageFiles/myfolder, but this doesn't return any folders

var dir =VirtualPathHandler.Instance.GetDirectory("~/PageFiles/myfolder/",true)

Now I see that files are saved different for each page, one page has the path /PageFiles/361/myfolder/ and another page has the path /PageFiles/65/myfolder/. All I want to do is be able to write

var dir =VirtualPathHandler.Instance.GetDirectory("~/PageFiles/myfolder/",true)

but to get any folder I have to write (for instance)

var dir =VirtualPathHandler.Instance.GetDirectory("~/PageFiles/65/myfolder/",true)

What is the correct way to get a PageFiles folder so I can access all files in it?

BTW, this is EPiServer 6.0

403 Error On CMS Provided Images

$
0
0

Within our site we have a number of areas where images, delivered from the CMS, are rendered on the pages.  Recently we have been seeing a lot of instances where the images are not showing when the page is viewed, instead we are receiving a 403 status against the images.  Eventually the image will resolve itself without any apparent intervention from our editors or admins.  The issue is only present in the production environment so debugging is incredibly difficult.

We are running EpiServer v11.9.2, hosted in DXC.

Error in FIND after update

$
0
0

Hello,

Recently we have updated out Episerver version and also FIND version. Now FIND version stands at 13.0.4.

We deployed at two server. One is testing and one is PROD. On testing everything seems to be working fine. When we deployed on PROD it gave error that findIndexQueueLoadItems already exists in DB. We checked it and it was inside the Stored Procedures. We deleted the file from DB. It gave error on 3-4 other files and we deleted them and then it was working. Episerver created the stored procedure again. 

We didn't had that issue on TEST enviornment. But now one of the pages are not being indexed in FIND. When we see in those particular stored procedure, the code on TEST and PROD are different. 

On TEST one of the stored procedures are like

USE [dbUdePortalenFeature]
GO
/****** Object:  StoredProcedure [dbo].[findIndexQueueSave]    Script Date: 12/17/2018 9:36:33 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[findIndexQueueSave]
(
    @action int,
	@cascade bit,
	@enableLanguageFilter bit,
	@item nvarchar(255),
	@itemlanguage nvarchar(255),
	@timeStamp datetime,
	@hash int
)
AS
BEGIN
	SET NOCOUNT ON
	if not exists(select * from tblFindIndexQueue where Hash=@hash AND LastRead IS NULL) 
		BEGIN 
			insert into tblFindIndexQueue(Action, [Cascade], EnableLanguageFilter, Item, [Language], TimeStamp, [Hash]) values(@action, @cascade, @enableLanguageFilter, @item, @itemlanguage, @timeStamp, @hash) 
		END 
	else
		BEGIN
			update tblFindIndexQueue set TimeStamp = @timeStamp where Hash=@hash
		END
END 

On PROD the same Store procedure looks like

USE [dbUdePortalenEpi10]
GO
/****** Object:  StoredProcedure [dbo].[findIndexQueueSave]    Script Date: 12/17/2018 9:36:39 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[findIndexQueueSave]
(
    @action int,
	@cascade bit,
	@enableLanguageFilter bit,
	@item nvarchar(255),
	@itemlanguage nvarchar(255),
	@timeStamp datetime,
	@hash int
)
AS
BEGIN
	SET NOCOUNT ON
	if not exists(select * from tblFindIndexQueue where Hash=@hash) 
	BEGIN 
		insert into tblFindIndexQueue(Action, [Cascade], EnableLanguageFilter, Item, [Language], TimeStamp, [Hash]) values(@action, @cascade, @enableLanguageFilter, @item, @itemlanguage, @timeStamp, @hash) 
	END 
END 

Any thoughts??

Add CmsAdmins claim in custom Owin middleware

$
0
0

Hello!

I´m trying to get editor mode to work with a custom IODC provider solution we are using. I thought I´d try to add a CmsAdmins claim to the principal in an Owin middleware.

* I based solution mostly on information in this article: https://world.episerver.com/documentation/developer-guides/CMS/security/federated-security/

* I´ve made sure CmsAdmins role is given access to editor pages in web.config: 

<location path="EPiServer">
<system.web>
<authorization>
<allow roles="WebEditors, CmsAdmins" />
<deny users="*" />
</authorization>
</system.web>
</location>

<location path="EPiServer/CMS/admin">
<system.web>
<authorization>
<allow roles="WebEditors, CmsAdmins" />
<deny users="*" />
</authorization>
</system.web>
</location>

* I add CmsAdmins claim to principal in an Owin middleware like so:

Despite this I still get 401 unauthorized when I try to access /episerver. Is something wrong with the CmsAdmins claim on principal? 

Update: When I check PrincipalInfo.HasAdminAccess value is true.

Warehouse InventoryStatus Ignored

$
0
0

Can someone clarify (or point me to where it is already clarified) in the warehouse documentation what the difference is between InventoryStatus of "Ignored" and "Disabled"? (I have the knowledge that "Disabled" inventories do NOT update the InStock number as purchases are completed.)

Also, I get that "Disabled" comes from the Edit Inventories UI being marked "IsTracked" but how would a product be set to "Ignored"?

There are some inconsistencies that I need help with:

It would be great to have the documentation updated in regards to this.

How to customize validation message for each field episerver form.

$
0
0

Hi,


I want to implement custom validation message for each filed in form,

Does anyone know if we can customize a validation message for each field?
Now I have two textboxes (Name, Email), those are required. When I click a submit button without input information those fileds, then the validation message show up "This Field is requied" (Standard episerver form). 

But I would like to have the validation message for show specific field name. Like "Please enter Name." and "Please enter Email".

Waiting to hear from any helps.

Thanks in advance.

Personalisation + Validation

$
0
0

I've a 'ContentArea' with a 'LimitContentAreaItems' validator attribute attached, but my issue is that the editors may wish to personalize items in the ContentArea, but the validation attribute doesn't take Personalisation into account when counting the blocks in the contentArea. Is it possible for me to write my own custom validator that could allow, for example, 4 items, but 2 items in each visitor group, so that validator will see that there are only ever 2 items enabled at once? So in the example I want to limit it too 2 items, but allow several personalisations such that the contentArea actually has several more items than just the 2.


How to search for media in web forms solution?

$
0
0

Hi!

I am trying to add a search to an episerver 11 web forms solution. I have added an episerver:searchdatasource to search for pages, and this works fine. But how do I search for mediafiles? I can't find any documentation on this.

Trim Content Versions job for Commerce catalog content

$
0
0

In CMS 11 we got the "Trim Content Versions" job for CMS content which uses the uiMaxVersions setting. 

Would be nice with a similar built-in job for Commerce content for cleaning up old previous versions of catalog entries. 

Episerver Commerce: Variant Inventory view

$
0
0

In Episerver Commerce UI on the "Inventory" tab on the variant it would be nice if the warehouse code was shown in the view next to the warehouse name/location. Right now current columns is shown: Location, Code (is the variant code and not the warehouse code), Quantity, Preorder Availability, Is Tracked

XForm into Block giving error

$
0
0

The Error is: 

The model item passed into the dictionary is of type 'Castle.Proxies.XFormBlockProxy', but this dictionary requires a model item of type 'XXX.Models.ViewModels.XFormPageViewModel'.

at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value)
at System.Web.Mvc.ViewDataDictionary.set_Model(Object value)
at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary)
at System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData)
at System.Web.Mvc.WebViewPage.set_ViewData(ViewDataDictionary value)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at EPiServer.Web.Mvc.ViewExtensions.Render[T](IView view, ViewEngineResult viewEngineResult, ViewContext context, TextWriter writer, T data)
at EPiServer.Web.Mvc.MvcContentRenderer.HandleRenderTemplateWithViewEngine(HtmlHelper helper, IContentData contentData, TemplateModel templateModel)
at EPiServer.Web.Mvc.MvcContentRenderer.Render(HtmlHelper helper, PartialRequest partialRequestHandler, IContentData contentData, TemplateModel templateModel)
at XXX.Business.Rendering.ErrorHandlingContentRenderer.Render(HtmlHelper helper, PartialRequest partialRequestHandler, IContentData contentData, TemplateModel templateModel)

Here is my code:

XFormBlock.cshtml

@using EPiServer.Web.Mvc.Html
@model XXX.Models.ViewModels.XFormPageViewModel<div class="xformblock" @Html.EditAttributes(x => x.Schema)>
    @Html.ValidationSummary()
    @using (Html.BeginXForm(Model.Schema, new { Action = Model.ActionUri }))
    {
        Html.RenderXForm(Model.Schema);
    }</div>

 

XFormBlock.cs

using System.ComponentModel.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServer.XForms;
namespace GoConstruct.Models.Blocks
{
    [SiteContentType(GUID = "E6CE8FD6-DCA9-454C-B219-2C4D0DB9E17D",
       GroupName = Global.GroupNames.Phase1point5,
       DisplayName = "1.5 X-Form Block",
       Description = "Add a form to the site", Order = 37)]
    [SiteImageUrl("/Static/Gfx/blocks/form.jpg")]
    public class XFormBlock : SiteBlockData
    {
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 1)]
        [CultureSpecific]
        public virtual string Heading { get; set; }
        [Display(
            GroupName = SystemTabNames.Content,
            Order = 2)]
        [CultureSpecific]
        public virtual XForm Schema { get; set; }
    }
}

 

XFormBlockController.cs

public class XFormBlockController : BaseBlockController<XFormBlock>
    {
        // GET: XFormBlock
       public override ActionResult Index(XFormBlock currentBlock)
        {
            var id = (currentBlock as IContent).ContentLink.ID;
            // ViewData is not automatically passed to a block controller, need to get it from TempData if it exists
            var viewDataKey = string.Format("TempViewData_{0}", id);
            if (this.TempData[viewDataKey] != null)
            {
                this.ViewData = (ViewDataDictionary)this.TempData[viewDataKey];
            }
            // Create the viewmodel
            var viewModel = new XFormPageViewModel(currentBlock, EpiServerDependencies)
            {
                Schema = currentBlock.Schema,
                Heading = currentBlock.Heading
            };
            var pageRouteHelper = ServiceLocator.Current.GetInstance<PageRouteHelper>();
            PageData currentPage = pageRouteHelper.Page;
            // Create postback url
            if (viewModel.Schema != null && currentPage != null)
            {
                var urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>();
                var pageUrl = urlResolver.GetVirtualPath(currentPage.ContentLink);
                var actionUrl = string.Format("{0}XFormPost/", pageUrl);
                actionUrl = UriSupport.AddQueryString(actionUrl, "XFormId", viewModel.Schema.Id.ToString());
                actionUrl = UriSupport.AddQueryString(actionUrl, "failedAction", "Failed");
                actionUrl = UriSupport.AddQueryString(actionUrl, "successAction", "Success");
                actionUrl = UriSupport.AddQueryString(actionUrl, "contentId", id.ToString());
                viewModel.ActionUri = actionUrl;
            }
            var editHints = this.ViewData.GetEditHints<XFormPageViewModel, XFormBlock>();
            editHints.AddConnection(v => v.Schema, p => p.Schema);
            return this.PartialView(viewModel);
        }
    }

XFormPageViewModel.cs

 

using EPiServer.XForms;
using XXX.Models.Blocks;
using XXX.Models.ViewModels.Base;
using JonDJones.Com.Core;
public class XFormPageViewModel : BlockViewModel<XFormBlock>
    {
        public XFormPageViewModel(XFormBlock currentBlock, IEpiServerDependencies epiServerDependencies)
           : base(currentBlock, epiServerDependencies)
        {
        }
        public XForm Schema { get; set; }
        public string ActionUri { get; set; }
        public string Heading { get; set; }
    }

 

Can you let me know if you can see where I am going wrong?

 

Many thanks

Jon

CategoryListEditorDescriptor is not being called

$
0
0

Hello everyone,

I have implemented the custom category list selector based on this thread:

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2015/5/multiselect-category-picker-for-7.5/

(i have EpiServer version 11 and i did the update to the code, minor)

But..  when i am going for the selection of the category for one of the my properties:

I am somehow getting all the categories available and not the ones under the newly defined category root - AirTaxonTopicCategory for that property.

I am trying to set the breakpoint to 'ModifyMetadata' in my CategoryListEditorDescriptor but it never hits it...

so, the question I like to clarify in this post - is it possible to to use the debugger breakpoint for 'ModifyMetadata' method in my 'CategoryListEditorDescriptor' class?


Is this the method that being called very early in the process, sets up the roots for all the CategoryList properties according to the attribute's settings and not available in the run time?

another question (i think related) - is there some sort of caching for the categories list? Can I turn it off? As it seems the categories list and roots that appear for
my properties are very sporadic.

thank you for your help and suggestions,
HF

P.S. one of my properties of type CategoryList, which in editor when selected list ALL of the categories, and not the ones under the root specified:

        [Display(Name = "Topic", Description = "Topic categories to choose from", Order = 3, GroupName = CustomTabNames.Taxonomy)]        [AirCategorySelection(RootCategoryType = typeof(AirTaxonTopicCategory))]        [Searchable]        public virtual CategoryList TaxonomyTopic { getset; }



Show "submitted from" value in mail

$
0
0

Hi, 

In formsubmission has a coloum "Submitted From", shows which page the user submitted the form from.

I am wondering is it possible to add this information in the mail (Send mail after submission)?

Thanks, 

ChiChing

Contentareas with the attribute [AllowedTypes(typeof(exampleBlockType))] does not move pages correctly

$
0
0

Hello!

Example faulty scenario:
Two contentareas, one with  [AllowedTypes(typeof())] and one without and a pageType created from PageData

- Unable to move page from non-decorated contentarea to decorated contentarea even with AllowedTypes set with the pagetype
- Unable to move page from decorated contentarea to non-decorated content area

Tested in both on-page-edit mode and all-properties edit mode. 


What scenario works? 

- Moving pages from the CMS treenode on the left side into the decorated contentarea


The problem seems to be with moving pages between the contentareas on-page-edit and all-property-edit mode.


How to makes blocks searchable in episerver?

$
0
0

I have used below code for making blocks searchable.

ContentIndexer.Instance.Conventions.ForInstancesOf<BlockData>().ShouldIndex(x => true);

Why specific blocks are not searchable in edit mode?

Does consuming another EPiServer site's content require an extra license?

$
0
0

Hi!

 A friend of mine told me that if I have a non-EPiServer website which consumes content from an EPiServer website, then an extra EPiServer-license is required. Is this true?

 Lets say I have a scenario like the following:

 I have an EPiServer site with cooking recipes called EPiCookingRecipes. On each site page there's a cooking recipe.

 Now a friend of mine has another site, NonEPiCookingRecipes, which is a simple ASP.NET MVC site not using EPiServer at all.

 In the EPiCookingRecipes site, I build a Web API exposing all recipes for use by my friend on his NonEPiCookingRecipes site.

 My friend - on his NonEPiCookingRecipes site - consumes API-data in the form of cooking recipes from my EPiCookingRecipes site.

 Would this require an extra EPiServer license?

 

If yes, can someone point me to the place where this is provided in the license agreement?

"Cache cleared" and EPiServer Application Reboot

$
0
0

I have a website where I use Episerver CMS 11 and also Commerce. I have an issue on my site where it is occasionally unresponsive for up to a couple of minutes. When recovered from this period of unresponsiveness, I have noticed the following line consistently in my log:

2018-12-13 00:14:15,167 [1] WARN EPiServer.Core.Internal.ContentCacheRemover: Cache cleared

The mystery-cache-clear is logged about 4-8 times per day, and seems to follow no pattern (except on 03:00 every day when I recycle app-pool in IIS). For example, this 24-hour period:

2018-11-11 03:00:27,079
2018-11-11 08:03:05,568
2018-11-11 12:12:04,301
2018-11-11 16:36:37,739
2018-11-11 19:48:09,106
2018-11-11 22:48:15,181

In my dev environment, I can trigger the "Cache cleared" message by running an iisreset.

I have noticed a warning event logged in windows Event Viewer -- under System -- for most of the periods of unresponsiveness, but not all.

Source: WAS, ID: 5011, Message:
A process serving application pool 'MyPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '3788'. The data field contains the error number.
Source: WAS, ID: 5010, Message:
A process serving application pool 'MyPool' failed to respond to a ping. The process id was '4500'.

My questions:
1. When/why does EPiServer log the "Cache cleared" message?
    1.a Is the message logged consistently on startup?
2. My theory is that the EPiServer app is rebooted, and that the cache is cleared on initialization.
    2.a Under what conditions can I expect EPi to reboot itself?
    2.b Under what conditions can I expect IIS to reboot EPi?
3. Other theories?

PropertySettings has unknown type EPiServer.Editor.TinyMCE.TinyMCESettings

$
0
0

Hi,

We recently migrate our EpiServer instance to the latest version.

Right now, we are trying to change a GlobalSettings which is inside a DataType and the DataType is inside a ContentType.

While doing this change, we are getting this error when adding a new Settings in the GlobalSettings:

Property PropertySettings has unknown type EPiServer.Editor.TinyMCE.TinyMCESettings, EPiServer.Cms.TinyMce



Would anyone of you had this issue and if so, how did you managed to change previously created GlobalSettings property.

Maybe this error is linked to this update?

https://world.episerver.com/blogs/Ben-McKernan/Dates/2018/3/an-updated-tinymce-package-has-been-released/

Thanks.

Duplicate LineItemId in cart

$
0
0

Hi,

We have a Commerce system with heavy load. As far as I know LineItemIds in a cart supposed to be unique for the cart - I also got this confirmed from a Commerce trainer. Our system depends on this.

Extremely rarely occurs a situation in production, when a cart contains LineItems where two of the LineItems have the same LineItemId. In one example which we have there are 11 LineItems, where except two LineItems all others have unique LineItemId.

We have no overrides in functions which is used by cart.CreateLineItem(), including IOrderGroupFactory. The corrupted cart is persisted in SerializableCart, so the problem should happen before creating an order. But exact reproduction steps are unknown for this.

Using Commerce version 11.2.3.

Is there any possible explanation for this or is it a known bug?

Thank you in advance!

Viewing all 6894 articles
Browse latest View live