Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

If you would like to add a hierarchical filter for date then add a tree view field to the Layer. For example I have three tagbox fields for Year/Month/Day in my Basic Information Layer and have added a Tree View field to display the date:

Picture of tree view field

I have entered the below in Levels. The allow recursion will be set to false by default after saving.

The fields will be shown in the filter in the order below. For an American date for example you may want to use month/day/year.

[
    {
        "fieldId": "year"
    },
    {
        "fieldId": "month"
    },
    {
        "fieldId": "day"
    }
]

Once this is done you need to add a Channel Filter:

image-20250108-090635.png

Where you can also set a path in addition to the usual Channel Filter settings. For an explanation of paths see tbd.

image-20250108-091040.png

This will then result in the Hierarchical Filter as pictured below:

image-20250108-091816.pngimage-20250108-091340.png

If you would like the filter to display a month name such as October instead of 10 then you can add code to the Name Display pattern of the list that is linked to your Month tagbox in this example. You will need to adjust this for multiple languages if required, or to only filter for e.g those List Items that have Month in the broader field so that you are sure to get a correct display.

{% assign month_names = "January,February,March,April,May,June,July,August,September,October,November,December" | split: "," %}

{% assign keyword_name = data.keyword.name | translate %}
{% assign state = data.keyword.state.name["x-default"] %}

{% assign is_number = keyword_name | plus: 0 %}

{% if data.keyword.broader %}
    {% assign broader_tags = data.keyword.broader | tagbox_name %}
    {% if broader_tags contains "Month" %}
        {% if is_number >= 1 and is_number <= 12 %}
            {% assign counter = 0 %}
            {% for month in month_names %}
                {% assign counter = counter | plus: 1 %}
                {% if counter == is_number %}
                    {% assign keyword_name = month %}
                {% endif %}
            {% endfor %}
        {% endif %}
    {% endif %}
{% endif %}

{{ keyword_name }}

{% if state != 'Active' %}  ¬{% endif %}

image-20250108-102151.png

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.