• OK – I’m hoping for a tip here – I basically have a loop that filters to the correct search results, then evaluates those results to run calculations based on fields stored in their City taxonomy and then displays the results.

    However, I have a condition where instead of the property-city taxonomy of the post, I may have to look up another record in property-city taxonomy by name. For example, if a property is Unincorporated, the calculations come from that county’s record in the City Taxonomy. I can programatically get the condition and the name of the unincorporated taxonomy, but I’m having a hard time looking up the data from the other record.

    Here’s my latest attempt (I have to make a lot of attempts to get things right, I’ll admit):

    [–if var=uninc value=YES]
    [set countyname]Unincorporated [field real_estate_county] County[/set]

    [-pass fields=countyname]
    [-loop taxonomy=property-city name={COUNTYNAME}]
    [—if taxonomy=property city name={COUNTYNAME}]
    [set new_taxid][field id][/set]
    [set new_fees][field propertyfees][/set]
    [/—if]
    [/-loop]
    [/-pass]
    [/–if]

    Help please?

    David

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try:

    [-pass field=countyname]
    [for each=property-city term='{FIELD}']
    [set new_taxid][field id][/set]
    [set new_fees][field propertyfees][/set]
    [/for]
    [/pass]
    Thread Starter dmunaretto

    (@dmunaretto)

    Thats returning the value of the current post… ?? Appreciate the suggestion though ??

    What I need to do is:

    Loop through ALL taxonomy property-city posts (not just those associated with the post)
    Get the one post that matches name {COUNTYNAME}
    And then set the variables to be used from that post

    Any ideas?

    Change this

    [for each=property-city term='{FIELD}']

    to this

    [for each=property-city term='{FIELD}' current=false]

    Thread Starter dmunaretto

    (@dmunaretto)

    Still no — I also added empty=true even though i made sure there was a post associated with it….

    [–if var=uninc value=YES]
    [set countyname]Unincorporated [field real_estate_county] County[/set]

    [-pass field=countyname]
    [for each=property-city term=”{FIELD}” current=false empty=true]
    [set lake][field id][/set]
    [/for]
    [/-pass]

    [–else]
    [set countyname][taxonomy property-city field=name][/set]
    [set lake][taxonomy property-city field=id][/set]

    [/–if]

    This part contains some errors -assuming you want to use field county-name as term.

    [-pass field=countyname]
    [for each=property-city term=”{FIELD}” current=false empty=true]
    [set lake][field id][/set]
    [/for]
    [/-pass]

    Should look like:

    [-pass field=countyname]
    [for each=property-city term='{-FIELD}' current=false empty=true]
    [set lake][field id][/set]
    [/for]
    [/-pass]

    as you are passing the field in nested pass [-pass]

    • This reply was modified 4 years, 1 month ago by polarracing.
    Thread Starter dmunaretto

    (@dmunaretto)

    Got it figured out — was a simple oops – [pass vars] not pass field–

    Thank you for your help! I didn’t actually realize that I needed the {- on the -pass so it was a huge assist – thanks again!

    David

    [-pass vars]
    [for each=property-city term='{-LAKE}’ current=false]
    ….
    [/-pass]

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Look up taxonomy value’ is closed to new replies.