• Resolved stuartgre

    (@stuartgre)


    How can you change the search field to search only properties with a specific flag?

    e.g. search by ‘_new_home_flag’

    • This topic was modified 5 years, 5 months ago by stuartgre.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Property Hive

    (@propertyhive)

    Hi @stuartgre,

    By ‘flag’ do you mean marketing flags? Or is this a custom field you’ve added called ‘_new_home_flag’?

    If the former the below should do it:

    https://gist.github.com/propertyhive/46a35fa4da6aa131e0fbbd2e57be0e39

    Let me know,

    Steve

    Thread Starter stuartgre

    (@stuartgre)

    Thanks Steve,

    I believe it’s all default flags, but I used https://gist.github.com/propertyhive/3bbe6d4ad2743029b9aa2bf3a54a1342 to update the flag and I’d now like to filter by this if possible, the file you just posted seems like it should do the trick though, let me give it a go ??

    Plugin Author Property Hive

    (@propertyhive)

    Ah ok. So you’re using a custom field, not marketing flags. Just to confirm you have this ‘New Home Flag’ field setup?

    By this I mean you have our Template Assistant add on installed and under ‘Property Hive > Settings > Template Assistant > Additional Fields’ you have a field setup called ‘New Home Flag’?

    If you can confirm the above I’ll get the code to you to allow you to filter on the above,

    Steve

    Thread Starter stuartgre

    (@stuartgre)

    Ahh, thanks Steve, I just tried with that code snippet you provided and it did work, but would it be possible to send the results off to a different page?

    e.g.
    normal form -> /normal results/
    flagged form -> /flagged results/

    Thread Starter stuartgre

    (@stuartgre)

    Sorry, yes we do have it set up like you described, but the original code did appear to work?

    Thread Starter stuartgre

    (@stuartgre)

    Ahh, actually it doesn’t need a new result page because the flag isn’t lost even though the default search form is used on the results page, it still keeps the &_new_home_flag=1 that’s great ??

    Thanks for your help Steve!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Customising the Search form’ is closed to new replies.