Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Filtering data items by the page being edited (for Selector or DataMultiIdSelector widgets within a custom function)

$
0
0
Hi Alexey

At the moment the widgets for function parameters aren't aware of the page they have been placed on.
Function ActivePageReferenceFilter wouldn't work, as it is intended for front end usage only.

Can I ask more about your use case? You're choosing a subset of the items because, the client doesn't want to show some of them, or because they have to be shown in different locations on the same page?

As an alternative solution - on some websites, the page template itself renders the spots and they have some meta data fields for choosing spots.
In custom markup for a meta data field, you can bind PageId to a nested method call that would populate the list of options (if that will work for you, I'll try to find an example).

On one of our own websites, we had to show spot items in 2 groups, so we just added an Order field to the page data type, and the function received Skip and Take parameters. That visually works ok with the new C1 4.2 "function preview" feature.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>