الفرق بين المراجعتين ل"استخدام pandora client/Creating custom fields and filters"

من ويكي أضِف
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب''''Adding New Fields''' To add new fields to pandora item, you have to add their definition code to the file yourSitename.jsonc that exists in the path pandora/pandora....')
 
ط
سطر 37: سطر 37:
 
                 {"id": "month", "sort": [{"key": "items", "operator": "-"}]}
 
                 {"id": "month", "sort": [{"key": "items", "operator": "-"}]}
 
</pre>
 
</pre>
 +
 +
You can modify these custom fields or any existing fields by editing them. To remove fields, just remove their code from this configuration file.

مراجعة 13:14، 3 يوليو 2014

Adding New Fields

To add new fields to pandora item, you have to add their definition code to the file yourSitename.jsonc that exists in the path pandora/pandora.

Field like event, year, month and day could be created by adding their code to item keys. Search about --> "itemKeys": [ and add the fields after any field inside this array like that:

        {
            "id": "event",
            "title": "Event",
            "type": "text" 
        },
        {
            "id": "year",
            "title": "Year", 
            "type": "year",
            "additionalSort": [{"key": "director", "operator": "+"}, {"key": "title", "operator": "+"}],
            "autocomplete": true,
            "columnWidth": 60,
           "filter": true
        },
        {
            "id": "month",
            "title": "Month",
            "type": "text"        
         },

Adding New Filters

To add new filters that to pandora user interface that help users in searching, add your custom filters to the same file that is used in adding fields. Search about --> "filters": [ and add your new filter line of code after any existing filter in the order you want like that:


                {"id": "event", "sort": [{"key": "items", "operator": "-"}]},  
                {"id": "year", "sort": [{"key": "name", "operator": "-"}]},               
                {"id": "month", "sort": [{"key": "items", "operator": "-"}]}

You can modify these custom fields or any existing fields by editing them. To remove fields, just remove their code from this configuration file.