photo

Eduardo Marques

shared this question
6 years ago

Employees Involved

photo

PIV Support

Admin

Statistics

27
Comments
1152
Views

Relates to

Share

2
votes

Trying to create a list of similar Listings at Listing Detail page

O-R v.3.1.14 - listing_detail_default.html file

I am trying to display a list of similar Listings at the Listing Detail page and I wish to use the {listings_custom_search_result_block} tag having inside it a Listing template tag. Is this possible?

I mean, for example, assuming a default installation, lets say I wish to list all Listings from "Washington" city at the "White House" example Listing detail page. I am trying:

{listings_custom_search_result_block $limit="5" $args="city={listing_field_city_value}"}<p><a href="{fulllink_to_listing}" title="{listing_title}"><img src="{raw_image_thumb_1}" alt="{listing_title}" /></a></p>{/listings_custom_search_result_block}

[]s

Eduardo

Add Comment

Comments (27)

photo Employee
1

You should be able to do that.

photo
1

Nope! The code I posted above is not working. Just tested at my local installation. Maybe block tags are being replaced by the core before listing tags? Could you please confirm... otherwise I will need to code an add-on.

Thanks! :)

[]s

Eduardo

[EDITED:] By the way, I also tried {listing_field_city_rawvalue}

photo
1

did you come up with a solution for this? I have been looking for this feature.

photo
1

Lee Forbes wrote:

did you come up with a solution for this? I have been looking for this feature.
Yep, I created an add-on to replace the custom search result block.

photo
1

Would you be willing to share?

Lee(at)forbespropertygroup.com

photo
1

Lee Forbes wrote:

Would you be willing to share?

Lee(at)forbespropertygroup.com

Lee, I can't - it was a commercial add-on. I will email "Oscar" and it will be up to him decide.

photo Employee
1

I think your code may work now. There was a bug regarding nested template tags in the search result block that was either fixed in v3.2 or is fixed for the next release.

photo
1

PIV Support wrote:

I think your code may work now. There was a bug regarding nested template tags in the search result block that was either fixed in v3.2 or is fixed for the next release.
With the latest v.3.2.1 it still do not work. Waiting next release and I will be glad to replace the add-on with that.

photo
1

{listings_custom_search_result_block}

does not work in OR pro 3.2.1 using listingview_main.html

Just tryed it...

photo
1

Lee Forbes wrote:

{listings_custom_search_result_block}

does not work in OR pro 3.2.1 using listingview_main.html

Just tryed it...

Lee, this is not an O-R file: listingview_main.html - it does not exist, maybe exist at "ORother"? :) - and the tag {listings_custom_search_result_block} DO WORK at a listing detail template file (O-R v.3.2.1). Read the initial post to see what don't work: listing field tag inside it.

photo
1

A note: while {listings_custom_search_result_block} actually works at a Listing Detail page (without Listing Field tags), it returns INTO the result, the same Listing where the custom block is placed which IMO, should be excluded from the result.

photo
1

listingview_main.html feature was released with OR 3.1.7

http://www.open-realty.org/blog/open-realty%C2%AE-317-released.html

photo
1

Lee Forbes wrote:

listingview_main.html feature was released with OR 3.1.7

http://www.open-realty.org/blog/open-realty%C2%AE-317-released.html

Wow! Thank you! That's not documented and naturally I haven't noticed it. For sure I will use that template! Thanks!

photo
1

Lee, I have also just tried the "listings_custom_search_result_block" at listingview_main.html and it works. But the same as any other Listing Detail template file, it does not work with listing field tags inside it. An add-on is still required.

photo Employee
1

My bad, this was fixed for the next release.

photo
1

works in the new OR 3.2.3 in the listingview_main.html template!

see it live demo

I am using the code below: {listings_custom_search_result_block $limit="5" $args="2314={listing_field_2314_value}"}<div><a href="{fulllink_to_listing}" title="{listing_title}"><img src="{raw_image_thumb_1}" alt="{listing_field_2314_value} real estate" style="float:left;padding: 5px;" />{listing_field_49_value}</a><br /><strong>{listing_field_176_value}</strong><br />{listing_field_2314_value}<br /><img src="{template_url}/images/bedrooms.png" width="38" height="38" alt="bedrooms" /><strong>{listing_field_32_value}&nbsp;<img src="{template_url}/images/bathrooms.png" width="38" height="38" alt="bathrooms" />{listing_field_2294_value}</strong><br /></div><hr />{/listings_custom_search_result_block}

A comment in Disqus or property social media share while you are on the page is always appreciated.

photo
1

OR V 3.2.5

I have to join this one too

I have an addon that captures the users City

I would love this method to show listings based on the user's city, so I did this.

{listings_custom_search_result_block $limit="5" $args="city={addon_location_city}"}

It's not working.

if I replace that tag {addon_location_city} with "Windsor" (no quotes), it shows the property in that city.

I know it's getting the value becasue if I place that tag {addon_location_city} anywhere else in the page, it will return the value "Windsor" (no quotes).

Am I missing something?

Thank you

PS

This is located on the main page not the listing details page but I cannot see why if it's pulling the correct value from the addon, but still not showing the listings from that city.

photo
1

I think your addon function runs after the page has been generated for the clients browser...

photo
1

Thanks Lee

I really don't think so because if it was so, that means it would initially load with a blank value and when it loads with a blank value

$args="city="

It would actually show the first 5 listings.

It is pulling the value but just not showing it.

Do you still have this working the way you mentioned it above?

You live demo link is not live at all.

photo
1

Wayne McGowan wrote:

OR V 3.2.5 ...

Am I missing something?

...

Please Wayne, where have you read add-on tags works inside custom search result block??? Am I missing something? :)

photo
1

I am not saying that addon tags woks in a custom search result. I was just saying that am must be missing something. It works on the listing details page when I use

{listings_custom_search_result_block $limit="5" $args="city={listing_field_city_value}"}

Because it is using {listing_field_city_value} to pull the city value of the current listing.

Just as {listing_field_city_value} returns the city value, my addon detects the user city and using the tag , returns the city value.

From that I assume that if I place the tag {addon_location_city} by city={addon_location_city}, it should place it there.

photo
1

Wayne McGowan wrote:

...I was just saying that am must be missing something...
Ahhh, OK! :) Yes, you are missing something: add-on tags do not work inside custom search result block. At the "Ideas" section you could post a Feature Request...

[]s

photo
1

Thanks Eduardo

I will do just that, for now I think I have to just let the same addon pull the listing info and display it. There I was thinking I got off easily.

photo
1

I am trying to get similar listings, how to get property class similar,

I put this code $args="pclass%5B%5D"

but doesn't work.

{listings_custom_search_result_block $limit="15" $args="pclass%5B%5D" $args="address={listing_field_address_value}"}<a href="{fulllink_to_listing}">{listing_title} </a> {/listings_custom_search_result_block}

photo Employee
1

You need to replace "%5B%5D" with "[]" and provide the class ID.

e.g.

pclass[]=X where X is the numeric property class ID you want to use.

If you don't want to restrict the output by class, omit the "$pclass[]" entirely.

You also cannot have multiple $args= statements, you can only use it once.

photo
1

Thanks for your support.

Actually I want to pull the similar listings of each property class.But the following custom search does't work.

{listings_custom_search_result_block $limit="15" $args="pclass[]" $args="address={listing_field_address_value}"}<a href="{fulllink_to_listing}">{listing_title} </a> {/listings_custom_search_result_block}

photo
1

Thanks PLV,

I am able to make similar listings as your guide

http://www.nepalhomesearh.com

Leave Comment

photo

Attach files...

The file must be a jpg, gif, png, bmp, ico, pdf, doc, rtf, txt, zip or rar no more than 20M