9 votes

How to Render Javascript per page or component?

An alternative to @Gatogordo's option is to use a modular approach to JavaScript using something like requirejs. I wrote a post about using requirejs to organize your js with Sitecore a while a go. ...
user avatar
  • 18.9k
9 votes
Accepted

Example of populating list in experience profile page with JSON data

I suggest you use a SearchDataSource and then bind it to your ListControl. Check this post for binding example: https://visionsincode.wordpress.com/2016/10/17/put-json-data-in-your-searchdatasource-...
user avatar
  • 318
6 votes
Accepted

Why is my Ajax url not recognizing my sitecore controller or hitting my breakpoint in my sitecore controller?

It's worth mentioning that the route in the question is called out in a setting. The comment above Mvc.IllegalRoutes explains itself a bit. <!-- MVC: Pipe separated list of route URL's that are ...
user avatar
  • 2,457
6 votes

Is there a way to write to the Sitecore logs via Javascript? (8.2)

Sitecore supports client-side event logging using JSNLog. Sitecore client logging uses JSNLog which has been wrapped to allow Sitecore to configure it via a patch and to make use of the existing ...
user avatar
5 votes
Accepted

How do I construct a reasonable JS implementation of canExecute() for an Experience Editor Button?

You would have to perform request to the server to check whether your current template meet certain criteria. Request class: using Sitecore.ExperienceEditor.Speak.Server.Contexts; using Sitecore....
user avatar
5 votes

Is it possible to edit fields in the Page Editor that are shown on hover?

For non-rendered fields, or things that are handled via javascript, etc, I use a combination of Edit Frames and EE views. The EE Views let you present the content in a way that can expose content and ...
user avatar
5 votes
Accepted

Video component YouTube elements are not clickable

The video component is handled by mediaelement.js, you'll need to edit the JavaScript file for this service in order to fix this issue. If you go to /sitecore/media library/Base Themes/Core Libraries/...
user avatar
5 votes

Sitecore 9.1 Experience editor throwing JS errors

For us, the problem was an Html.Glass().Editable(...) inside the href of a link. That did not break the Experience Editor in Sitecore 8.1. The init method of Sitecore.PageModes.ChromeManager throws ...
user avatar
  • 106
4 votes

Why is my Ajax url not recognizing my sitecore controller or hitting my breakpoint in my sitecore controller?

First off, @PatrickBarron is absolutely correct about your route. However, there is one other issue that I see. Have you tried dropping the word "Controller" off the name of your controller when ...
user avatar
4 votes

Example of populating list in experience profile page with JSON data

I think you will find your answer in this blog from Jonathan Robbins. It is quite some code - too much to copy here. An overview of what is all in his example: SubPageCode rendering The Border ...
user avatar
  • 19.2k
4 votes

How to Render Javascript per page or component?

This might be an opinion based question.. but I'll give the approach I usually take. In general I would keep all css and javascript bundled and minified together. This means visitors will load some ...
user avatar
  • 19.2k
4 votes
Accepted

Add custom redirect on SPEAK logout

EDIT: Update based on comments If you check the definition of LogoutArgs used in the processor, there is a property called RedirectUrl that is of type: Sitecore.Text.UrlString - if you set this ...
user avatar
  • 18.9k
4 votes
Accepted

Sitecore FXM with Coveo, dynamic html does not seem to render

Simon, I found an answer. There is an FXM variant of $(document).ready (more details here) So solution is to customize SearchBoxView and substitute existed inline js code with FXM-aware js code: &...
user avatar
4 votes

Whats is the correct way to implement FXM generated script

In a distributed environment, you must enable the following two configuration files on all the servers: Sitecore.FXM.Bundle.config Sitecore.FXM.config Also, make sure that the following ...
user avatar
  • 17.8k
4 votes

How to show a loading image mean while a submit form is being executed in Sitecore 9 Forms

You can add some javascript on your webpage to listen on your submit button and show a loader icon. To have some handles, you can add custom css classes on your submit buttons. This can be done, ...
user avatar
4 votes

Create new user with JSS

It does not exist now. For that you would need an web API which also contains some backend validation to not blow up your user database. In backend you can easily create users using Sitecore API. At ...
user avatar
3 votes
Accepted

A serious error occurred please contact the administrator

with in Sitecore.ExperienceEditor.Speak.Server.RequestArgs class the method name to execute defaults to Process. Check the last line in below method. public RequestArgs(string commandPath, ...
user avatar
  • 794
3 votes

Why is my Ajax url found when I test in preview mode, but not when I bring up the page in a url I get not found errors

I would recommend creating a custom route for Ajax functionality that doesn't reside in the Sitecore Shell. From my understanding, using the default route of /api/Sitecore only works if you are logged ...
user avatar
  • 4,259
3 votes

How to Render Javascript per page or component?

Sitecore Habitat solution might have what you are looking for. Pipeline: For each rendering you specify a js/css asset or a line of script. In the mvc.getPageRendering pipeline it gathers up all ...
user avatar
2 votes
Accepted

Angular JS directive with MVC integration Experience Editor errors

There is a helper method @Html.RawJsEncodedString in my post that you need to use here. You need to wrap you @Html.Sitecore().Field("Title") in that method so that it will encode quotes and correctly ...
user avatar
2 votes

JS scripts optimization results in syntax error

This seem to be not a bug in SXA Could check whether you can download some media item (js/css) from media library and see how it behave? I can see server response with error appended to a file after ...
user avatar
2 votes

Undefined error when clicking Publish in Experience Editor

We were able to track down the issue. It had to do with a pipeline patch in the mvc.getRenderer pipeline--we were patching in before "Sitecore.Mvc.Pipelines.Response.GetRenderer.GetViewRenderer, ...
user avatar
  • 203
2 votes

Sitecore jQuery version compatibility

There are some ideas here that you might be able to use Steve: Dealing with jQuery version collisions in WFFM e.g unloading jquery after testing it: if (typeof jQuery != 'undefined' && ...
user avatar
2 votes

Sitecore Experience Editor not working with ".slick" command

I know this is old but I faced a similar issue with slick and experience editor. Slick by default will assume that all direct children of the carousel div should be slides and since EE injects its own ...
user avatar
  • 219
2 votes

Whats is the correct way to implement FXM generated script

You need to set the FXM.Hostname setting to a hostname that is handled by your CD server. Use a config patch like this: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <...
user avatar
  • 3,263
2 votes

WFFM custom toggle switch

You're rendering the HTML markup directly in your cshtml file, but you need to use the Html Helpers. I suggest you take a look at the default Checkbox field markup located in /Website/Views/Form/...
user avatar
  • 13.7k
2 votes
Accepted

How to extend SXA components scripts?

Starting form SXA 1.7 we've added an option to extend the component's script and we are using it also in the SXA to change the behaviour of few components in the Edit mode. You can create new Theme ...
user avatar
2 votes
Accepted

loading partial view from jquery

As there are many ways to solve this issue, I ended up using a combo of modifying my controller code and pulling in the view through an ajax call. Here's the final solution. Controller [HttpGet] ...
user avatar
  • 159
2 votes

loading partial view from jquery

This doesn't map 100% to what you want, but I normally wrap this in a WebApi controller and within that, call this code which renders HTML from a View Rendering: using System; using System.IO; using ...
user avatar
2 votes
Accepted

Sitecore datetime to javascript Date object

JavaScript equivalent of ISO date format used in Sitecore is 2017-04-01T07:30:00Z. You first need to convert from 20170401T073000Z to 2017-04-01T07:30:00Z and then create new Date object: var ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible