Skip to content

Instantly share code, notes, and snippets.

@fanderwald
Created August 9, 2024 14:44
Show Gist options
  • Save fanderwald/c4ad829d3bb3aa30b5d0d55b88b795a7 to your computer and use it in GitHub Desktop.
Save fanderwald/c4ad829d3bb3aa30b5d0d55b88b795a7 to your computer and use it in GitHub Desktop.
<?php
/**
* The Template for single floorplans
*
*/
$context = Timber::context();
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
$specials = rentfetch_get_floorplan_specials();
$floorplan_title = rentfetch_get_floorplan_title();
$beds = rentfetch_get_floorplan_bedrooms();
$baths = rentfetch_get_floorplan_bathrooms();
$square_feet = rentfetch_get_floorplan_square_feet();
$available_units = rentfetch_get_floorplan_available_units();
$links = rentfetch_get_floorplan_links();
$pricing = rentfetch_get_floorplan_pricing();
$floorplan_units_headline = wp_kses_post( apply_filters( 'rentfetch_single_floorplan_units_headline', '<h2>Units</h2>' ) );
$units_count = rentfetch_get_floorplan_units_count_from_meta();
$description = rentfetch_get_floorplan_description();
$floorplan_tour_headline = wp_kses_post( apply_filters( 'rentfetch_single_floorplan_tour_headline', '<h2>Take a look around</h2>' ) );
$iframe = rentfetch_get_floorplan_tour_embed();
$similar_floorplans = rentfetch_get_similar_floorplans();
$more_floorplans_headline = wp_kses_post( apply_filters( 'rentfetch_single_floorplan_more_floorplans_headline', '<h2>Similar floorplans</h2>' ) );
$context['specials'] = $specials;
$context['floorplan_title'] = $floorplan_title;
$context['beds'] = $beds;
$context['baths'] = $baths;
$context['square_feet'] = $square_feet;
$context['available_units'] = $available_units;
$context['links'] = $links;
$context['pricing'] = $pricing;
$context['units_count'] = $units_count;
$context['floorplan_units_headline'] = $floorplan_units_headline;
$context['description'] = $description;
$context['floorplan_tour_headline'] = $floorplan_tour_headline;
$context['iframe'] = $iframe;
$context['more_floorplans_headline'] = $more_floorplans_headline;
$context['similar_floorplans'] = $similar_floorplans;
Timber::render( array( 'single-floorplans.twig' ), $context );
{% extends "base.twig" %}
{% block content %}
<main class="main-content-wrapper">
<div class="single-floorplans-container-outer container-current-floorplan-info">
<div class="single-floorplans-container-inner">
<div class="current-floorplan-info">
<div class="images-column">
{% do action( 'rentfetch_do_floorplan_images' ) %}
</div>
<div class="content-column">
{% if specials %}
<p class="specials">{{specials}}</p>
{% endif %}
{% if floorplan_title %}
<h1>{{floorplan_title}}</h1>
{% endif %}
{% if pricing %}
<p class="pricing">{{pricing}}</p>
{% endif %}
<div class="floorplan-attributes">
{% if beds %}
<p class="beds">{{beds}}</p>
{% endif %}
{% if baths %}
<p class="baths">{{baths}}</p>
{% endif %}
{% if square_feet %}
<p class="square-feet">{{square_feet}}</p>
{% endif %}
</div>
<div class="floorplan-buttons">
{% do action( 'rentfetch_do_floorplan_buttons' ) %}
</div>
{% if description %}
<div class="floorplan-description">
{{description | wpautop}}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% if units_count > 0 %}
<div class="single-floorplans-container-outer container-units">
<div class="single-floorplans-container-inner">
<div class="units">
<h2>{{floorplan_units_headline}}</h2>
{% do action( 'rentfetch_floorplan_do_unit_table' ) %}
</div>
</div>
</div>
{% endif %}
{% if iframe %}
<div class="single-floorplans-container-outer container-tour">
<div class="single-floorplans-container-inner">
<div class="tour">
<h2>{{floorplan_tour_headline}}</h2>
{{iframe}}
</div>
</div>
</div>
{% endif %}
{% if similar_floorplans %}
<div class="single-floorplans-container-outer container-similar-floorplans">
<div class="single-floorplans-container-inner">
<div class="similar-floorplans">
<h2>{{more_floorplans_headline}}</h2>
{{similar_floorplans}}
</div>
</div>
</div>
{% endif %}
</main>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment