Sort documents in Kentico 9 Document Library Widget - sorting

We are using the Kentico 9 Document Library Widget to display a list of files in a folder. But what I cannot find is a way to set the sort order of the files being displayed seems to be random.
Do I have to customize the widget to have to do a sort based on a date field for example?

You have to make ORDER BY property visible in Widgets application. You can set default value or set proper ordering in widget properties dialog.
Note to Boris: Document libary is one of the abandoned features in v9.

Related

Having multiple pages with multiple identical elements managed by a single code

in my xamarin application I have multiple pages that contain the same elements (header and horizontal menu), and every time I have to make a change I have to change the code in every single page, there is a way to insert fixed elements in each page ?
In xamarin, use Xamarin.Forms control templates to achieve what you want.
First create a template, design the style you want and set bindable parameters. Then when you use it, you only need to import the class directly, and you can flexibly bind the values you want to use.
For more information, please refer to the official documentation: Xamarin.Forms control templates.

Hide/remove options from a view's grid header filtering

I've been looking for an approach to remove unwanted values from a views grid column filtering dropdown but I'm not sure if its even possible.
A specific view in our app only displays results where the column will contain 5 values, however the column option set has 20+. Is it possible to remove the unwanted 15 values from being displayed when the view's filter by function is used?
This documentation does not mention any way the values can be hidden.
I have added a web resource to a view column before, to change text values into an image, however I don't think this is an applicable place to add a script to hide filter by values.
I have developed plugins so not against using this medium if the approach works and does not introduce a performance hit.
Unfortunately that header filter is not open for customization/configuration. Though MS mention it as Excel like filter, it is not going to give the filter options for only values from current list. It will load the full options list.
When we had such requirements in the past - we have developed a PCF control with grid + filters and used it instead.

Is it possible to filter a subgrid based on what is selected in a dropdown field?

Is it possible to filter a subgrid (Or some sort of list) based on what a user has selected in a dropdown field? If yes, how can I do this?
There is no easy way to do this.
For previous versions, there were some approaches to achieve this requirement (supported or unsupported way). Later this broke and ended up with community recommended Plugin approach. Read more
Since this is picklist dependent, I would assume the list items are few, probably you can build views based on dropdown values & manipulate the subgrid view based on the form value. Read more
Worst case, you can build a custom HTML webresource to render a grid by querying using web api filters.

Sitecore Content Editor generates Random GUI element properties or which are not unique on webpage like xPath, ID or Class

While automating Sitecore Content editor (backend) i have come across one problem that, while adding the same component, values of element ID's and xPath changes. Elements like add here or approve button etc.
I would like to know if there is a way while developing the components we can render the element properties (GUI properties like xPath, ID or Class) in specific pattern or if components can be generated with the same element values like ID or xPath.
GUI properties are used in element identification on GUI and if they change everytime scripts always fail.
If you want to Sync the Sitecore Items, there are some great tools like Unicorn(Free) and TDS from (hedgehog), or you should use the Sitecore Packages to move items between instances(not for development).
If you want to just create or access the Item Properties you can always access them through Sitecore Powershell module: SitecorePowershell

How to set theme id property on Components?

Whatever I do, only theme set in application properties applies. Theme id doesnt work as expected.
For example:
I have two custom controls and each has 5 views. I try to set view title property for all views in first custom control with theme and same with second custom control, but with different theme (and title).
Both custom controls exist on same page.
Problem Im trying to solve is, instead of typing functions for properties for each component of same type I want to do it only in one place. In that case all views in one custom control. Or all views in a panel...
Regarding Themes: afaik we only can define a single theme per application. This theme can inherit from other themes but those need to be installed and registered at the file system level for the entire server.
Regarding your scenario:
If you really want to solve that with themes you could work with separate theme ids. But I really don't see the benefit of using themes here. As far as I understand your task I would solve it using custom properties for your custom controls. The view title would then be computed to reference that property as in
<xp:viewTitle xp:key="viewTitle" id="viewTitle1"
value="#{javascript:compositeData.ccViewTitle}">
</xp:viewTitle>
At design time the containing Xpage or Custom Control would then feed the appropriate view title to the child control:
<xc:ccInner ccViewTitle="View Title for First CC in Page"></xc:ccInner>
<xc:ccInner ccViewTitle="View Title for Second CC in Page"></xc:ccInner>
You also could compute this value, if necessary.

Resources