Support » Plugin: Pods - Custom Content Types and Fields » PODS custom field relationship Drop Down Issue

  • Resolved baljindersingh88

    (@baljindersingh88)


    Hi
    I have created a custom field Task Status with name task_status (It’s a custom relationship Drop Down)
    Create in this way
    1|Done On Time
    2|Pending Done
    3|Not Done On Time
    4|Not Done
    Now in my listing i want to assign a class based on the status like class=”status_1″, class=”status_2″, class=”status_3″
    I am able to access the value of task status using {@task_status} , it displays “done on time” , Pending Done” etc.
    How can i get the key like 1,2,3,4
    I have wasted a lot of time on issue
    Any help will be appreciated.

    Thanks
    Baljinder Singh

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Are you using PHP?

    Maybe try $value = $pod->field( 'task_status' ); and that will get you the value.

    You can use $options = $pod->fields( 'task_status', 'data' ); to get the array of options, you can then match up and output however you’d like.

    In the future, I’d love to see us add something like task_status.value support, specifically for using with magic tags.

    Thread Starter baljindersingh88

    (@baljindersingh88)

    Hi Scott,
    Thanks for your reply.

    We sorted it out by using {@task_status,value}
    PODS is awesome.Keep up the good job.

    Thanks
    Baljinder Singh

    Plugin Author Jim True

    (@jimtrue)

    Baljinder, I had no idea that would work in Magic Tags with Simple Custom Defined Lists. That’s good to know and I’ll get that tested and added to our docs.

    Thread Starter baljindersingh88

    (@baljindersingh88)

    Wondering you are unaware of it.
    Anyway thanks for the support

    Baljinder

    Plugin Author Jim True

    (@jimtrue)

    Most people, believe it or not, are only interested in the value to be displayed, so it doesn’t come up as a question that often.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PODS custom field relationship Drop Down Issue’ is closed to new replies.