Discussions

Ask a Question

Edit Form Set Focus

Is it possible to set the focus of the first field in the form that people use to add/edit items in a template? I tried adding the following to `template.js`, but it didn't run. ```javascript // the #field1 selector is wrapping the first field in the popup add/edit view setFocusToFirstField('#field1'); function setFocusToFirstField(selector) { console.log('I was called.'); // Get the parent element using the selector var parentElement = document.querySelector(selector); if (parentElement) { // Find the first input, select, or textarea within the parent element var formField = parentElement.querySelector('input, select, textarea'); // If a form field is found, set focus to it if (formField) { formField.focus(); } } } ``` I should add that I'm trying to do this in an older template that has all of that `jpList` stuf in it.

/API/OpenContent/DnnEntitiesAPI/UsersLookup throws 500 error

When clicking on Add or Edit on an item, I get a blank page without a text editor and this error in the console. Tried logging in as Admin or Host, both face the same issue. OpenContent v4.4. Tried upgrading to v4.7 but the issue persists. Stack trace: AbsoluteURL:/API/OpenContent/DnnEntitiesAPI/UsersLookup DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:9a0cd1e4-6e8d-4b44-81d6-790f6ab8e744 AssemblyVersion: PortalId:-1 UserId:-1 TabId:-1 RawUrl: Referrer: UserAgent: ExceptionHash:2BqIFA9EDqc3eyI5eg+HGDoRPUQ= Message:Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details. StackTrace: at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken) at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger) at System.Web.Http.ModelBinding.FormatterParameterBinding.<ExecuteBindingAsyncCore>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Controllers.HttpActionBinding.<ExecuteBindingAsyncCore>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext() InnerMessage: InnerStackTrace: Source:System.Web.Http FileName: FileLineNumber:0 FileColumnNumber:0 Method:

OpenContent templates for Porto error

When using the OpenContent templates for Porto on a Dnn v9.11.0 instance, I get the following error: "An error occurred while trying to save the Porto-Accordion file. Contact your hosting provider to ensure the appropriate security settings have been enabled on the server". An error is displayed in the view, but no related errors were logged in the admin logs or Log4NET log file. Has anyone had this type of error before?

Checkbox default set to checked

I'd like to use a checkox, "type": "checkbox", and have the default value to be checked. How could I do that?

Get data from external select2 field

Hi, I'd like to call all the options from an external select2 field. {{#each Options.fields.RelatedProductGroup}}<div>{{Title}}</div>{{/each}} returns the right amount of divs, but I cannot get the related Title field...

Open Content 4.7 CKEditor File Upload

We are using the CKEditor in our templates and would like to enable file upload. Typically, in an HTML module using CKEditor, you can open the link dialog and there is a tab for Upload and button for Browse. I am not sure how to tell the configset to use the default upload and brose functionality. I was able to get the advanced tab to show up, but that does not have the upload functionality we are looking for.

Display localized optionValues instead of enum in Handlebars

Sorry for being a bit tiresome atm (I am trying to learn...), but here is my next question: I have the following lines in my schema.json to define a field (Category): "Category": { "type": "string", "enum": [ "Telephone", "Fax", "Mobile" ], "title": "Category" }, options.json: "Category": { "type": "select", "optionLabels": [ "Telephone", "Fax", "Mobile" ], "title": "Category" }, options.de-AT.json: "Category": { "type": "select", "optionLabels": [ "Telefon", "Fax", "Mobiltelefon" ], "title": "Kategorie" }, template.hbs: <p>{{Category}}</p> When editing the items, everything works fine, except the labels in the edit form are not localized ("Category" instead of "Kategorie") - the values in the dropdown list are in the correct language. In the view, the values are displayed in English ("Telephone" instead of "Telefon"). How can I display the localized strings in the view? And how can I display the labels in the correct language?

(Static) Localization in {{#each Items}} loop not working

I want to display a category in each item, here is the code (template.hbs): {{#each Items}} <p>{{Localization.Category}}: {{Category}}</p> {{/each}} (localization.de-AT.json): { "Category":"Kategorie" } This displays only the colon and the name of the category, but not the word "Kategorie". Anyway, this code is working as expected (displays the word "Kategorie" followed by paragraphs with 0, 1, 2, 3...): <p class="CategoryHeader">{{Localization.Category}}: {{Category}}</p> {{#each Items}} <p>{{@index}}</p> {{/each}} Any ideas?

Using localization in jQuery functions

Hi, is it possible to use localization in jQuery functions? Example: I have a localization file (localization.de-at.json): { "ExpandAll":"Alle ausklappen", "CollapseAll":"Alle einklappen" } I want to use the dnnExpandAll jQuery plugin like this: $("#DemoPanel .dnnFormExpandContent a").dnnExpandAll({ targetArea: "#DemoPanel", expandText: "{{Localization.ExpandAll}}", collapseText: "{{Localization..CollapseAll}}" }); But this does not work. How do I achieve this?

Use select2 to query data from a dropdown list

For some reason we cannot seem to get the select2 data out of another open content module. This is the options json. { "fields": { "items": { "fields": { "location": { "type": "string" } } } } } And this is the schema.json { "type": "object", "properties": { "Locations":{ "type": "array", "items": { "location": { "type": "text" } } } } } we are trying to extract a list of locations from this array using: "Locations": { "type": "select2", "dataService": { "data": { "moduleId": "3833", "tabId": "76", "valuefield": "Id", "textfield": "Location", }, "action":"Lookup" }