Paste FLATRIS code on website following the instructions from the Integrating apartments grid on webiste section.
Add attribute 'onclick' to your button/link:
<a href="#" onclick="create_chess();return false;">Open crosstab</a>
Example https://web.flatris.com.ua/custom_links.html
If you want to open different apartments grids on the same page you should enter cid
as a parameter for function create_chess()
:
<a href="#" onclick="create_chess('P3XQb0g7V0zAg1G');return false;">Apartment Complex First</a>
<a href="#" onclick="create_chess('e18Xg6kQDxydMQj');return false;">Apartment Complex Second</a>
The cid
parameter you can get from the code:
If there is no opportunity to add the 'onclick' attribute (eg on CMS Tilda) you can add the following JS code to the site
<script>
$('body').on('click', '#rec118364942 .tn-elem__1183649421564138943305 a', function(e){
e.preventDefault();
create_chess();
});
</script>
Where '#rec118364942 .tn-elem__1183649421564138943305 a
' - is your button/link selector.
How do you get the selector on CMS Tilda? To do so open the site in Chrome browser, by the right mouse button click the button/link to which you want to connect the action of opening apartments grid and select "View code":
Then on the right of the code block click with the right mouse button on the selected element "Copy" => "Copy selector":