Source Immo Templating System

Source Immo Templating System

Source Immo Templating System

Overview

Source Immo renders its front-end output using PHP view files located inside the plugin directory:

/wp-content/plugins/source-immo/views/

Developers can override any of these view files by replicating the exact same directory structure and filename inside a child or parent theme. The plugin will automatically load the theme version instead of the default plugin template.

This mechanism is update-safe and does not require modifying plugin core files.


Resolution Order (Lookup Priority)

When rendering a template, Source Immo resolves files in the following order:

  1. Child theme

    /wp-content/themes/{child-theme}/source-immo/views/{relative-path}.php
  2. Parent theme

    /wp-content/themes/{parent-theme}/source-immo/views/{relative-path}.php
  3. Plugin default (fallback)

    /wp-content/plugins/source-immo/views/{relative-path}.php

Important:
The relative path and filename must match exactly (including case sensitivity on Linux/production servers).


Directory Structure (Plugin views/)

Below is a condensed tree of the provided views/ directory (3–5 levels deep where relevant):

views/
├── list/
│ ├── index.php
│ ├── pages.php
│ ├── listings/
│ │ ├── index.php
│ │ ├── direct/
│ │ │ ├── index.php
│ │ │ ├── item-standard.php
│ │ │ ├── item-layer.php
│ │ │ ├── item-minimal.php
│ │ │ ├── item-archive.php
│ │ │ └── list-meta.php
│ │ ├── standard/
│ │ │ ├── index.php
│ │ │ ├── header.php
│ │ │ ├── item-standard.php
│ │ │ ├── item-picture-only.php
│ │ │ └── list-meta.php
│ │ ├── search/
│ │ │ ├── layout_full.php
│ │ │ ├── layout_focused.php
│ │ │ └── panels/
│ │ │ ├── price.php
│ │ │ ├── cities.php
│ │ │ ├── categories.php
│ │ │ └── _actions.php
│ │ ├── slider/
│ │ │ └── item.php
│ │ └── sort.php
│ ├── brokers/
│ │ ├── index.php
│ │ ├── direct/
│ │ ├── standard/
│ │ ├── search/
│ │ └── sort.php
│ ├── agencies/
│ │ ├── direct/
│ │ ├── standard/
│ │ └── search/
│ ├── offices/
│ │ ├── direct/
│ │ ├── standard/
│ │ └── search/
│ └── cities/
│ └── direct/

└── single/
├── index.php
├── listings.php
├── listings_404.php
├── listings_layouts/
│ ├── standard.php
│ ├── print/
│ │ ├── header.php
│ │ ├── description.php
│ │ ├── financial.php
│ │ └── ...
│ ├── print-com/
│ │ └── ...
│ └── subs/
│ ├── header.php
│ ├── header_price.php
│ ├── description.php
│ ├── rooms.php
│ ├── image_gallery.php
│ └── ...
├── brokers.php
├── brokers_layouts/
│ ├── standard.php
│ └── subs/
│ ├── contact.php
│ ├── listings.php
│ ├── reviews.php
│ └── ...
├── agencies.php
├── agencies_layouts/
├── offices.php
└── cities.php

Example Path Mappings

Plugin ViewTheme Override Path
views/list/listings/direct/item-standard.php…/source-immo/views/list/listings/direct/item-standard.php
views/list/listings/search/panels/price.php…/source-immo/views/list/listings/search/panels/price.php
views/single/listings_layouts/subs/header_price.php…/source-immo/views/single/listings_layouts/subs/header_price.php
views/single/brokers_layouts/subs/contact.php…/source-immo/views/single/brokers_layouts/subs/contact.php
views/single/listings_layouts/print/header.php…/source-immo/views/single/listings_layouts/print/header.php

How It Works (Conceptual)

Internally, the plugin uses a template loader that:

  1. Receives a relative path (e.g., list/listings/direct/item-standard.php)

  2. Checks if that file exists in the child theme

  3. Falls back to the parent theme

  4. Falls back to the plugin default

Because the plugin file remains untouched, this system is:

  • Update-safe

  • Non-destructive

  • Fully reversible (remove override → fallback restores)


How To: Override a View

Step 1 — Identify the Template

Examples:

  • views/list/listings/direct/item-standard.php

  • views/single/listings_layouts/subs/header_price.php

  • views/single/brokers_layouts/subs/contact.php

Step 2 — Mirror the Directory in Your Child Theme

wp-content/themes/your-child-theme/
└── source-immo/
└── views/
└── list/
└── listings/
└── direct/

Step 3 — Copy the File

Copy from:

/wp-content/plugins/source-immo/views/list/listings/direct/item-standard.php

To:

/wp-content/themes/your-child-theme/source-immo/views/list/listings/direct/item-standard.php

Step 4 — Edit Safely

  • Preserve existing variables

  • Escape all output

  • Avoid removing required conditionals

Step 5 — Clear Caches & Test

  • Page cache

  • Object cache

  • CDN

  • OPcache (if applicable)


Available Views (Key Templates)

Relative PathPurpose (Inferred)Key Variables (Observed by Context)
list/listings/direct/item-standard.phpListing card (standard layout)$listing, $config
list/listings/direct/item-layer.phpOverlay-style listing card$listing
list/listings/standard/header.phpListings archive header$context, $filters
list/listings/search/panels/price.phpPrice filter panel$filters
single/listings_layouts/standard.phpMain single listing layout$listing
single/listings_layouts/subs/header_price.phpListing price block$listing
single/listings_layouts/subs/rooms.phpRooms/specs section$listing
single/brokers_layouts/standard.phpBroker profile layout$broker
single/agencies_layouts/standard.phpAgency layout$agency
single/offices_layouts/standard.phpOffice layout$office

Refer to the full tree above for all available templates.


Variables & Context (Important)

Rules

  • Do not rename expected variables.

  • Do not unset or override core objects.

  • Avoid business logic inside views.

  • Keep templates presentation-focused.



Example — Custom Layout Override Using single/brokers_layouts/standard.php

This example demonstrates how to override:

views/single/brokers_layouts/standard.php

and modify the layout without changing plugin logic, while preserving the original do_shortcode() calls provided by Source Immo.


Goal

  • Keep all existing shortcodes

  • Preserve $show_listings logic

  • Introduce a modern layout structure:

    • Header section

    • Two-column layout (main content + sticky sidebar)

    • Footer area for reviews and navigation

  • Avoid modifying internal shortcode behavior


Step 1 — Copy the Original Template

From:

/wp-content/plugins/source-immo/views/single/brokers_layouts/standard.php

To:

/wp-content/themes/your-child-theme/source-immo/views/single/brokers_layouts/standard.php

Step 2 — Modify the Layout (HTML Structure Only)

Below is a safe override example that restructures the page using semantic wrappers and CSS classes, while preserving all do_shortcode() calls and conditions.

<?php echo do_shortcode('[si_broker_part part="presentation"]'); ?>

<div class="si-broker-page">

<!-- Main Layout: Content + Sidebar -->
<div class="si-broker-layout">

<!-- Main Column -->
<main class="si-broker-main" role="main">

<section class="si-broker-section si-broker-about">
<?php echo do_shortcode('[si_broker_part part="about"]'); ?>
</section>

<section class="si-broker-section si-broker-specs">
<?php echo do_shortcode('[si_broker_part part="specs"]'); ?>
</section>

<section class="si-broker-section si-broker-listings">
<?php
if (!in_array($show_listings, ['false', '0', 'no'])) {
echo do_shortcode('[si_broker_part part="listings"]');
} else {
echo do_shortcode('[si_broker_part part="listings_call_to_action"]');
}
?>
</section>

</main>

<!-- Sidebar -->
<aside class="si-broker-sidebar" role="complementary">

<div class="si-broker-sidebar-inner">

<section class="si-broker-section si-broker-rating">
<?php echo do_shortcode('[si_broker_part part="rating"]'); ?>
</section>

<section class="si-broker-section si-broker-cities">
<?php echo do_shortcode('[si_broker_part part="cities"]'); ?>
</section>

<section class="si-broker-section si-broker-stats">
<?php echo do_shortcode('[si_broker_part part="stats"]'); ?>
</section>

<section class="si-broker-section si-broker-contact">
<?php echo do_shortcode('[si_broker_part part="contact_form"]'); ?>
</section>

</div>

</aside>

</div>

<!-- Footer Area -->
<footer class="si-broker-footer">

<section class="si-broker-section si-broker-reviews">
<?php echo do_shortcode('[si_broker_part part="reviews" hide_empty="1"]'); ?>
</section>

<nav class="si-broker-section si-broker-nav">
<?php echo do_shortcode('[si_broker_part part="list_navigation"]'); ?>
</nav>

</footer>

</div>


Debugging

Confirm Which File Is Loaded

Add:

<?php /* Loaded from child theme override: list/listings/direct/item-standard.php */ ?>

Then inspect page source.

Log Template Path

<?php error_log('SI template loaded: ' . __FILE__); ?>

Common Gotchas

  • Folder must be source-immo, not source_immo

  • Incorrect subfolder level

  • Case mismatch on production

  • Caching layers not cleared

  • OPcache still serving old version


Performance & Caching

  • Template resolution may be cached.

  • Always purge:

    • Page cache

    • Object cache

    • CDN

    • OPcache

If referencing versioned assets, consider bumping asset versions.


Best Practices

  • Always use a child theme.

  • Override only what you need.

  • Keep overrides minimal.

  • Diff overrides after plugin updates.

  • Escape all output.

  • Keep logic out of views.


FAQ

Where do overrides go?

/wp-content/themes/{child-theme}/source-immo/views/{relative-path}.php

Child theme is preferred.


Can I add new templates not referenced by the plugin?

Only templates explicitly loaded by the plugin will be resolved automatically.
You may include your own partials inside overridden templates.


What if a child theme exists?

Priority order:

Child → Parent → Plugin

If an override breaks the page?

Rename or remove the override file.
The plugin fallback template will load automatically.
Reapply changes incrementally.


Changelog Impact

Overrides persist across plugin updates.
However, if template variables or structure change, your override may become outdated.

Best practice:

  • After updating Source Immo

  • Diff your overridden templates

  • Compare against updated plugin versions


Summary

The Source Immo templating system allows full front-end customization using a safe and predictable override hierarchy.

Quick Checklist

  • Use a child theme

  • Mirror source-immo/views/ structure

  • Match relative path & filename exactly

  • Keep required variables

  • Escape all output

  • Clear caches & test

  • Diff overrides after plugin updates