• Resolved supadigital

    (@supadigital)


    Hi

    I trying to setup a relationship field that will list all possible titles from another post type, BUT – when selected, will display a field from within the selected option.

    EG: I have PROVIDERS pod and PRODUCTS pod.

    In PROVIDERS, there is an field to input a RATING number, EG: 3.5

    In PRODUCTS, I want to be able to display a LIST of PROVIDERS which one can select, and upon selecting, I can then display the VALUE from the RATING field from the selected PROVIDER.

    I am able to setup a list view that simply lists all the actual rating values, but I have no idea which belongs to which provider. Which doesnt help me.

    OTHERWISE,

    Is there a way, using PODS TEMPLATES, whereby I can simply display the RATING value from the a specific PROVIDER using a WHERE statement? If so, what is the syntax to achieve this.

    EG: display RATING where PROVIDER = provider name. or something like this..

    I hope you understand what I’m trying to achieve. Any assistance would be much appreciated.

    Thanks in advance.

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

    (@keraweb)

    Hi @supadigital

    This seems more like a general web-development question that a specific Pods question.

    What do you mean with “select”. Is it a form element? If so, you’ll need some custom javascript to show the correct values.
    In order to target the correct values by code you’ll need to wrap all these with their own attributes.

    Simple example:

    
    [each providers]
    <div id="rating-{@ID}">{@rating}</div>
    [/each]
    

    Not the rating-{@ID}. This will output an id specific for this rating which you can then use in Javascript to hide/show elements based on your selection.

    Good luck with your project!

    Cheers, Jory

Viewing 1 replies (of 1 total)
  • The topic ‘Getting Post Title from Relationship Field Rather than Value of Field’ is closed to new replies.