Discussions

Ask a Question

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" }

Collect data from other OC module

In your manifest example I noticed the use of an extra additionalData item called Customers. In my case I also need to connect to an other OC module. Before, I used options.json for this, but the downside is that form builder cannot be used anymore, so I was happy to see this. However, when I tried to use it like this, the data is not being collected in the edit of the article... I used it exactly like Category is used. Is this working? ```my AdditionalData manifest.json "additionalData": { "Exposities": { "title": "Exposities", "dataModuleId": 1729, "dataTabId": 751 } } ``` ```the field in options.json "Expositie": { "type": "select2", "dataService": { "action": "LookupData", "data": { "dataKey": "Exposities", "valueField": "Id", "textField": "Title" } } } ```

JPList filter by Date picker input

Hi, We use Web Api to load data, where it have StartDate & EndDate field. By default it load all data, and allowing users to filter by StartDate & EndDate. We've been struggle on how to use the Input filter for Date. Have tried couple thing, also tried to use jQuery-UI Date picker, but it's still not working: ``` <input data-path=".StartDate" type="date" value="" data-datepicker-func="datepicker" data-datetime-format="{month}-{day}-{year}" data-control-type="date-picker-filter" data-control-name="StartDate" data-control-action="filter" /> ``` Is there a sample of how to Filter by date?
ANSWERED

Comparing enum value to optionLabels value in order to write correct optionLabels in template

I have a simple template with in the options a dropdown field (called Soort) with enum pdf, word, excel, powerpoint, image and archive. It has the optionLabels Pdf, Word, Excel, PowerPoint, Afbeelding and Zip-bestand. I use the enum for constructing a Fontawesome label like 'fa-file-image'. I use the optionLabels to have the user understand what kind of file it is (Dutch) like 'Afbeelding'. In my template I want to render both the enum and the optionLabels of the chosen option. The result must be this: ``` <a href="linktoimage.jpg" download="" ><i class="far fa-file-image mr-2"></i>Download Schoolplan (Afbeelding, 333 kB)</a> ``` In order to achieve this I tried: ``` <a href="{{Upload}}" download=""><i class="far fa-file-{{Soort}} mr-2"></i>{{Title}} ({{arrayindex ../Options.fields.Links.items.fields.Soort.optionLabels @index }}, {{Size}})</a> ``` The arrayindex returns Pdf, so that doesn't work. I tried stuff like: ``` {{#each ../Schema.properties.Links.items.properties.Soort.enum }} {{arrayindex ../../Options.fields.Links.items.fields.Soort.optionLabels @index }} {{/each}} ``` ...but that just generated a list of the optionLabels. Somehow I need to compare the value of 'Soort' with index in the enum and the index in the optionLabels. For the time being I solved it temporary like this: ``` <a href="{{Upload}}" download=""><i class="far fa-file-{{Soort}} mr-2"></i>{{Title}} ({{#equal Soort "pdf"}}Pdf, {{/equal}}{{#equal Soort "word"}}Word, {{/equal}}{{#equal Soort "excel"}}Excel, {{/equal}}{{#equal Soort "powerpoint"}}Powerpoint, {{/equal}}{{#equal Soort "image"}}Afbeelding, {{/equal}}{{#equal Soort "archive"}}Zip-bestand, {{/equal}}{{Size}})</a> ``` ...but that isn't very future-oriented. Any ideas? Thanks!