Quantcast
Channel: Using Optimizely Platforms
Viewing all 8020 articles
Browse latest View live

Utilizing Service API for RESTful Services

$
0
0

Hello,

I'm trying to use Postman to run a GET request to retrieve a token in order to be able to retrieve content data for put together REST methods within my Epi environment.

I'm following the documentation at [https://world.episerver.com/documentation/developer-guides/Episerver-Service-API/installation-and-configuration/] and using the information from the Authorization Token example to run a GET request within Postman but it doesn't seem to be working.

Am I missing something? Is there documentation or tutorials anywhere that explains how to do this clearer?

Thanks. 


Proposal for js ajax pagination

$
0
0

I'm using episerver find with ajax functionality and pagination and I noticed that FindApi() is adding the onclick attribute for tracking but it is not exposing the function itself.

Thus when i'm using the pagination on ajax call i loose the tracking onclick script since it is triggered on window onload only and the function is defined on the addEvetListener as anonymous in bindWindowEvents.

It would be nice to extract the function like attachOnClickAttribute (sorry the code in find.js comes minified already):

this.bindWindowEvents = function() {
    var t = this;
    window.history && (window.onbeforeunload = function() {
        var e = document.location.href;
        e.indexOf("q=") > 0 && -1 == e.indexOf(t._dontTrackQueryParam + "=") && window.history.replaceState(window.history.state, window.document.title, e + (e.indexOf("?") > 0 ? "&" : "?") + t._dontTrackQueryParam + "=true")
    }
    ),
    window.addEventListener("load", function() { t.attachOnClickAttribute() }, !1)
},
// Extract function
this.attachOnClickAttribute = function() {
    var t = this;
    var e = t._toArray(document.getElementsByTagName("A"))
      , r = document.createElement("A");
    r.href = document.location.href;
    for (var n = 0; e.length > n; n++) {
        var a = function() {
            for (var a = !1, i = e[n].href, o = t._getTrackQueryParamsFromUrl(i), s = 0; o.trackQueryParams.length > s; s++)
                if (0 == o.trackQueryParams[s].indexOf("id")) {
                    a = !0;
                    break
                }
            if (o.trackQueryParams.length > 0 && a) {
                var c = document.createElement("A");
                c.href = i,
                ("/" != t._applicationUrl && r.hostname + t._applicationUrl != c.hostname + "/" + c.pathname.split("/")[1] + "/" || "/" === t._applicationUrl) && (e[n].href = t._serviceApiBaseUrl + "_click?" + t._trackParam + o.trackQueryParams.join("&" + t._trackParam) + "&" + t._trackParam + "redirect=" + encodeURIComponent(t._getUriWithoutTrackParams(i, o)),
                e[n].setAttribute("onclick", "window.location.href = '" + t._serviceApiBaseUrl + "_click?" + t._trackParam + o.trackQueryParams.join("&" + t._trackParam) + "&" + t._trackParam + "redirect=" + encodeURIComponent(t._getUriWithoutTrackParams(i, o)) + "'; return false;"))
            }
        };
        a()
    }
}
,

And then expose the find api object:

<script>
if (FindApi) {
	var api = new FindApi();
	api.setApplicationUrl('/');
	api.setServiceApiBaseUrl('/find_v2/');
	api.processEventFromCurrentUri();
	api.bindWindowEvents();
	api.bindAClickEvent();
	api.sendBufferedEvents();
	window.findApi = api; // expose the object 
}</script>


In a way that on js after clicking on the pagination i could trigger something like this

// On ajax pagination 
if (window && window.findApi) {
    window.findApi.attachOnClickAttribute();
}

Using tracking and StaticallyCacheFor

$
0
0

Hi,

When using tracking and StaticallyCacheFor together it results in two calls to the EPiServer Find index.

http://es-eu-dev-api01.episerver.net/ABCD/my_index_name/_search?search_type=count

http://es-eu-dev-api01.episerver.net/ABCD/my_index_name/_track/RcAYJkdFsLnYT6cF2K1npQ==

The index that we are on can handle up to 50 queries per second. Does anyone know if the above calls will count towards the 50 queries per second?

Thanks 

Default Sorting Order of Products in category - Using the CMS UI

$
0
0

On our product list pages the products returned seem to be in the order they were published.

Our normal sortng seems to work fine. 

case SortingType.Price:
search = search.OrderBy(p => p.SearchPrice());
break;
case SortingType.PriceReverse:
search = search.OrderByDescending(p => p.SearchPrice());
break;
case SortingType.TopRated:
search = search.OrderByDescending(p => p.AverageRating)
.ThenByDescending(p => p.ReviewCount);

We need the products to be returned in the order they appear in the CMS editor so that the content editors can visuall see and sort the products.

EPiServer Commerce Framework 
Version: 11.8 (build: 2)

Kind Regards

Sandeep

Stylesheet not working properly when pushing from Integration to PreProduction

$
0
0

Hey all, 

Our team is having a strange issue. From local environment to integration, our stylesheets are working and functioning as expected. All the styling in local is identical, with no weirdness happening. We ran into a problem yesterday when pushing from Integration to our Preproduction environment. The stylesheet data is either getting corrupted, not being applied entirely or not being applied at all. On pages and blocks where the styling works perfectly fine in our integration environment, in preproduction the styling is completely off. 

Our Senior Developer has tried making several other pushes to Preproduction with minor tweaks to CSS files, but nothing seems to trigger Preproduction to update the Stylesheets. Does anyone have suggestions as to how to get or force our Preproduction environment to update the CSS files?

Any advice, experience or direction to explore would be super helpful. Thank you in advance. 

Insert script tag through Page/Block editing view (TinyMCE)

$
0
0

Hi,

what would be the most preferable way to support inserting of script tag through TinyMCE when editing Page/Block?

Thanks!

Best Bets - Commerce Not Working

$
0
0

Hi Guys,

In my project I am using Find, In Best Bets we have 3 options,

1. Local

2. Commerce

3.External Link

  I tried to use Commerce option (Mapping category elements for my search) in Best Bets,

Its not working.

I need some code samples as well, If any.

thanks in Advance.

Uncaught ReferenceError: FindApi is not defined

$
0
0

Getting this js error in the console on the site: Uncaught ReferenceError: FindApi is not defined .  Identified that FindApi is not part of our custom solution, but rather out-of-the-box with Episerver Find.  Wondering if anyone has seen this before and know what causes this?

Site Details:
EPiServer.CMS version=10.10.1
EPiServer.CMS.Core version=10.10.4
EPiServer.CMS.UI version=10.10.2
EPiServer.CMS.UI.Core version=10.10.2
EPiServer.Commerce version=10.8.0
EPiServer.Commerce.Core version=10.8.0
EPiServer.Commerce.FindSearchProvider version=8.14.3
EPiServer.Commerce.UI version=10.8.0
EPiServer.Commerce.UI.ManagerIntegration version=10.8.0
EPiServer.DeveloperTools version=2.2.2
EPiServer.Find version=12.6.2
EPiServer.Find.Cms version=12.6.2
EPiServer.Find.Commerce version=9.8.0
EPiServer.Find.Framework version=12.6.2


Content Delivery API: CMS Version Requirements

$
0
0

Hello,

Is it possible to use Episerver.ContentDeliveryApi with Episerver version 10 or is it is necessary to be on version 11?

If the latter is the case then is ServiceAPI the best for using RESTful services with verison 10 CMS content(posts, pages blocks, etc.) or is there another option? 

Thanks

PromotionInformationGetRedemptions sql being called too many times

$
0
0

Hi,

I am using Commerce 12.15.0.

I am trying to find the promotion price of an item using GetDiscountPrices method (I pass the content reference and the market to it). And I see from the reflector it is calling the GetRedemptionsFromDatabase method behind the scenes which in turn triggers the PromotionInformationGetRedemptions sql. And upon looking into the SQL Profiler, I see this being called many times which I was hoping will not be the case and this will be read from the cache instead. Also, this only happens when the redemption limits are set.

Example: When I set the redemption per customer to 1 (Promotion used : Buy Products for Discount on All Selections)

This has a significance performance impact, I was hoping this could be cached instead and not trigger a db call everytime. Is this expected behavior?

Application restart loop because of "BuildResult change, cache key=cindexingservice.svc.1f180bcd"

$
0
0

Hello everyone!

We are currently experiencing an issue that has started happening more and more frequently recently and we don't really know how to proceed to track it down...

For some reason our application pool decides to restart about 1-2 a week nowadays and once it has sucessfully restarted once it only runs for 5-10 minutes before restarting again in a restart loop. It keeps doing this until we perform an IIS reset or restart the entire webserver. Once we do this the problem always stops.

In order to try and figure out why the application is restarting I have added some code to catch the reason in the "Application_End" event in Global.asax.cs:

protected void Application_End()
{
	HttpRuntime runtime = (HttpRuntime) typeof(HttpRuntime).InvokeMember("_theRuntime",
		BindingFlags.NonPublic
		| BindingFlags.Static
		| BindingFlags.GetField,
		null,
		null,
		null);
	if (runtime == null)
		return;
	string shutDownMessage = (string) runtime.GetType().InvokeMember("_shutDownMessage",
		BindingFlags.NonPublic
		| BindingFlags.Instance
		| BindingFlags.GetField,
		null,
		runtime,
		null);
	string shutDownStack = (string) runtime.GetType().InvokeMember("_shutDownStack",
		BindingFlags.NonPublic
		| BindingFlags.Instance
		| BindingFlags.GetField,
		null,
		runtime,
		null);
	Logger.Log(
		Level.Critical," ==== APPLICATION END EVENT ====" + Environment.NewLine + shutDownMessage + Environment.NewLine
		+ shutDownStack + " ==============================="
	);
}

With this code in place we see this message in our logs each time the application restarts:

FATAL Piab.CMS.Global: ==== APPLICATION END EVENT ====

BuildResult change, cache key=cindexingservice.svc.1f180bcd

HostingEnvironment initiated shutdown

HostingEnvironment caused shutdown

It's always the same message each time. Even the "1f180bcd" part seems to be static. The only file called "Indexingservice.svc" in our project comes from the EPiServer.Search package and is located at the \IndexingService\IndexingService.svc path. I'm not sure if this means that our problem is somehow related to indexing/search and the EPiServer.Search package or if the restarts would still happen with a different message if we remove it.

We have a testing/staging server but unfortunately we've never seen this error there and we've never been able to reproduce it ourselves.


I have googled all I can for similar error messages but the only thing I find is the Microsoft.NET reference source code that decides to return the "BuildResult change, cache key=" part of the message I now see in the logs...

Has anyone of you guys seen this type of error and/or does anyone have any idea about how to proceeed troubleshooting something like this?
No modified dates are changing on this file itself or any other file in the "bin" folder... We've also tried to disable the IIS file system watcher completely (so dynamic recompilations should not be happening?):

<httpRuntime fcnMode="Disabled" ... />

Since we disabled this the application no longer restarts automatically if we manually edit a .cshtml file for example so the IIS should not be monitoring any files modified/created date and kick off any dynamic recompilations because of such things...

Expired pages are still appearing in the search bar at the front end

$
0
0

Expired pages are still appearing in the search bar at the front end

Exception: Failed to load content type with name 'CategoryData' when working with Geta.EpiCategories plugin

$
0
0

I've been struggling with an exception while I'm trying to import the package to one of the websites -

This has been due to the plugin installed - https://github.com/Geta/EpiCategories

So it's expecting a ContentType named 'CategoryData' which in my case I've two/category - 

 [ContentType]
    public class PressCategory : CategoryData
    {
    }
    [ContentType]
    public class GuestReportingCategory : CategoryData
    {
    }

And the block has a property that basically overrides the default Category of page/block

Any idea what may have happened?

Exclude expired content from the Link Status report

$
0
0

Hi 

Currently the Link Status report shows broken links that are present on expired pages and blocks. Can broken links that are on expired content be ignored by the report as our clients don't need to fix content issues that aren't visible by anyone?

Thanks

Jonathan.

Approval upon page version deletion via Versions gadget

$
0
0

We are currently trying to use Approval Workflows together with Change Approval Add-on. We have noticed that when a page is available (published) in both English (master) and Swedish and the Swedish version is being deleted via Versions gadget, no approval is required to perform the operation.

After spending a couple of days with EPi support guys we found out that this is not implemented and it was suggested that we create a topic here in order to track the status of the feature request.

We would highly appreciate if there was an indication on when this functionality might be included into an EPi version.


Move dynamic datastore to another solution

$
0
0

Hi!

How can I move a dynamic datastore to another solution? We are building the site on the same database, so basically, I need to change the namespaces. 

Add support for culture specific properties on MediaData

$
0
0

As far as I know there's no official way of adding culture specific properties to MediaData content.
For example: I would like to add a culture specific description and alt text to an image and I'd like to translate that.

Do you have any suggestions on how to do this, is support for this on the roadmap somewhere?

I know about these options but I was wondering if there's any better alternative (as I don't think media is indexed in different languages, for example): 
https://www.patrickvankleef.com/2014/06/16/use-culture-specific-mediadata-properties/ 
https://gregwiechec.com/2015/07/localizable-media-assets/ 
https://support.episerver.com/hc/en-us/articles/360000495192

Find UI not working with CMS.UI refresh

$
0
0

I've tried to install the latest EPI Commerce / CMS and Find packages. However I run into the issue that the EPI Find Admin screens in the back-end are not working anymore after the UI refresh. It throws several Dojo JavaScript errors. Is this 1. a known issue and if so 2. when is a new version expected with support for the refreshed UI?

Exact versions used of packages (related to UI):

  • Commerce.UI: 13.7.0
  • CMS.UI: 11.21.5
  • Find: 13.2.3
  • Find.CMS: 13.2.3
  • Find.Commerce: 11.1.1

Spend for amount promotion with unit level exclusion

$
0
0

I would like to see a new promotion where you can have a spend for amount condition and exclude it on unit level.

The use case we want to support is this:

We have two promotions that exclude each other:

  1.  20% off on [Pro Episerver Commerce Creating powerful eCommerce solutions]
  2.  Spend for 100$ and get 10% off on [Books]

With unit level exclusion this should result in:

  1. 20% off on [Pro Episerver Commerce / Creating powerful eCommerce solutions]
  2. 10% off on [Episerver Commerce: A problem - solution approach / Solving problems, one at a time]

Provided we buy for 100$ or more.

It would be preferable if the discounted price for [Pro Episerver Commerce / Creating powerful eCommerce solutions] is used to calculate the 100$ and [Episerver Commerce: A problem - solution approach / Solving problems, one at a time] isn't counted at all, but that might not be necessary for all clients/use cases.

Calculating discounted price

$
0
0

Hi

How can you calculate the discounted prices for a diferent customer group/price group?

private IEnumerable<DiscountedEntry> GetDiscountedPrices(ContentReference contentLink, IMarket CurrentMarket, IBaseContext context)
{
var promotionEngine = container
.With<PromotionEngineContentLoader>(container.With(context)
.GetInstance<CustomPromotionEngineContentLoader>())
.GetInstance<IPromotionEngine>();

return promotionEngine.GetDiscountPrices(
new[] { contentLink },
CurrentMarket,
CurrentMarket.DefaultCurrency,
referenceConverter,
lineItemCalculator);
}

Viewing all 8020 articles
Browse latest View live