• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to Create a Custom Metadata Date field

Explorer ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

I have been using the SDK information, and have successfully added custom data fields using data type = String and enum

I would like to add a date field that will display as a date in the Library search field. 

 

I have been using just a string to hold the date, but it is treated as text in search. 

 

Is there a data type when defining your fields for a date / time? 

 

Is this just a matter of formatting? 

 

Your help is appreciated.  

TOPICS
SDK

Views

831

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 03, 2020 Jun 03, 2020

The SDK allows just three types: "string", "enum", and "URL". It doesn't provide any mechanism for controlling how they are displayed. So if how the value is displayed is important, you'll need to store string values in the format you want users to see them.  There have been requests for years to expand the metadata capabilities of plugins:

https://feedback.photoshop.com/photoshop_family/topics/lightroom_sdk_support_all_data_types_in_custom_metadata

 

Plugs do have one minor way to control the d

...

Votes

Translate

Translate
LEGEND ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

The SDK allows just three types: "string", "enum", and "URL". It doesn't provide any mechanism for controlling how they are displayed. So if how the value is displayed is important, you'll need to store string values in the format you want users to see them.  There have been requests for years to expand the metadata capabilities of plugins:

https://feedback.photoshop.com/photoshop_family/topics/lightroom_sdk_support_all_data_types_in_custo...

 

Plugs do have one minor way to control the display of custom metadata fields in tagsets -- they can tell LR to use multiple lines for displaying string values and allow newlines on input:

 

{'com.adobe.caption', height_in_lines = 15, allow_newlines = true,  topLabel = true}

 

(I assume you've read Chapter 4 of the Lightroom Classic Programmers Guide.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

My main focus is being able to create a date field for 2 reasons: 
1. Be able to use the field or fields for date calculations
2. Be able to search with the date hierarchy versus just a flat query like text fields. 

I believe I can parse the info to do calculations from the text field, but was hoping for something easier. 

 

And yes I have been through the manual, as well as other lua resources. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 03, 2020 Jun 03, 2020

Copy link to clipboard

Copied

LATEST

In some of my plugins, I've created two fields, once that's hidden and in a format that's easy to parse, and one that's visible and nicely formatted for display to users.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines