• Resolved Harry Hobbes

    (@harry-hobbes)


    Can anyone please point me to the naming rules (or naming conventions) for PODS item labels and field labels? (That is, length restrictions, legal characters, prohibited characters, etc.)

    Thank you in advance…
    – Harry

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @harry-hobbes

    As far as I know there are no real limitations to labels.
    Names (identifiers) can be anything that can be used as an array key.

    Cheers, Jory

    Thread Starter Harry Hobbes

    (@harry-hobbes)

    Okay, thank you Jory…

    Thread Starter Harry Hobbes

    (@harry-hobbes)

    Jory, et al,

    The geneses of the original query above was to determine if any naming limitations affect PODS field name processing, and resultant rendering of the values within the fields. I now have better information to share:

    Be advised that a custom post type field label that begins with “PODS_” or “PODS-” is manipulated by something so as to strip those characters from the [resultant] field name when the field is displayed via short code on a WordPress page.

    Being “old school,” I tend to “descriptively label” field names so that the names convey as much information as possible in the label/name itself. This got me into trouble with PODS because I prefaced field label with “PODS_” (indicating the source, as well as the usage of the field). (Because each custom post type consists of 40+ fields, it’s important to descriptively label each field. Also note that other plug-ins are dealing with information within the custom post type in other forms, so it’s imperative to differentiate with explicit labeling.)

    However, this labeling scheme broke the display of PODS fields on a webpage. The following describes the issue:

    Specifically:

    1. I have a created and published custom post type labeled “PODS Artifact” (plural label: “PODS Artifacts”) which has a field labeled “PODS Artifact ID”. PODS renders the field name correctly to “pods_artifact_id”.

    2. I then created and published a PODS Artifact with the value “Art-2020-02-15” in the PODS Artifact ID field. This works correctly, as one might expect.

    3. I then build and publish a PODS template (“PODS Template – Artifact”) to display the “pods_artifact_id” field. The template build works correctly, as expected.

    4. I then build a standard WordPress page and using the PODS command button in the classic editor, insert the short code:

    [pods name=”pods_artifact” limit=”99″ template=”PODS Template – Artifact”]

    When the page is published and viewed, the following is displayed:

    {pods_artifacts_artifact_id}

    This indicates that PODS is stripping a portion of the custom post type field name (“pods”) before concatenating that name with the name of the custom post type (“pods_artifacts”).

    Further investigation indicates the behavior is consistent when “PODS” occurs as the first characters of the field label (and associated name, in lowercase). Prepend another value, such as “FLD_PODS_”, or do not prepend “PODS_”, and no stripping occurs, and everything works correctly as expected.

    Note that my investigation is not exhaustive and I do not know what other character values, if any, are affected.

    Best regards,
    Harry

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    There aren’t any intentionally built in limitations for anything prefixed with “pods_”

    Further, you don’t need to prefix anything with Pods or any variation like that. When naming your Pods, Fields, or Templates, simply name them to the context of their architecture itself.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Naming Convention?’ is closed to new replies.