Discussions
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"
}
}
}
```
Posted by Keston almost 2 years ago
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?
Posted by Erwin almost 2 years ago
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!
Posted by Keston almost 2 years ago
Download link for Client Side Catalog Template? to load 10k data
Hello,
We currently have 10k data that we're importing from Ventrian Property-Agent module into open content.
Copying it into RawData is fine, but when it load the page, it throw error "Too much data to deserialize. Please use a client side template to circumvent that."
Update the limit of jsonSerialization maxJsonLength didn't solve it, so we're thinking to implement Client Side load, but no sample template we can find for reference.
But I see that this page is implement Client side rendering with 10k data:
http://www.openextensions.net/opencontent-demos/client-side-catalog
Wonder where we can grab the template for this sample page?
Posted by Erwin Yulianto almost 2 years ago
JPList is deprecated and been abandoned, is there any alternative?
Implement JPList on OpenContent for sorting and filtering is a really nice to have.
But when we're facing issue and try to figure solve it, the website is no longer available, and have difficulty for fixing it since it lack documentation.
https://github.com/1rosehip/jplist it's been deprecated.
While https://github.com/1rosehip/jplist-es is a new one, this repo seems been abandoned by the creator.
There's couple of question with no reply.
Is there any other alternative for it?
Posted by Erwin Yulianto almost 2 years ago
Display multi-item detail on separate page
When a multi item open content is created, the detail URL of the page exists within `{Context.DetailUrl}`. However, when using the context link, the detail page will show on the same page with modules above it. How can use the `{Content.DetailUrl}` handlebars helper as a link to open the details of the template in a new page, void of other content?
Posted by Brian Dukes about 2 years ago
Related articles
Hi there,
Is there a way to have, in a OpenContent module using the Articles template, a detail page of an article including a list of related articles? The relation should be formed through a corresponding AdditionalData field, like Tags.
This is a functionality I have been missing for a while now.
I know I can have the admin do this manually, via a field in the article edit, but I am looking for automation...
Maybe there are workarounds?
Keston
Posted by Keston about 2 years ago
Crop ratio
Hi,
Is there a way I can crop an image using the imagex field and keep the ratio of every image I crop? It looks like I must choose an image size... I tried adding the old "aspectRatio": 1, but that doesn't do anything anymore... I'm actually just looking for a way to reduce file size...
Posted by Keston almost 3 years ago
Cannot add class to link
How can I add a class to a hyperlink?
Posted by Keston almost 3 years ago
Calling label from dropdown
Is there a way to call the label (and not the value) of a dropdown option?
Something like {{field:label}}?
Posted by Keston almost 3 years ago