Show blocks depending on the property
With WP-ImmoMakler, every block in the WordPress editor gets the section WP-ImmoMakler: Visibility. It lets you show a block only for certain properties or hide it for certain properties. Typical examples:
- The heading “Videos” appears only if the property has videos.
- A “No commission” note appears only if the buyer’s commission field is empty.
- Reference properties get their own note, all other properties get an enquiry button.
This applies to all blocks, including groups: if you hide a group, everything inside it disappears.
Setting up a condition
Section titled “Setting up a condition”-
Select the block
In the editor, select the block, for example a heading or a group containing a heading and the Videos block.
-
Open the section
In the sidebar on the right, under Block, open the section WP-ImmoMakler: Visibility.
-
Choose show or hide
Under This block, choose only show if or hide if.
-
Add conditions
Under Add condition, choose a feature, for example “Property content: Videos”. You can add several conditions; all of them must then be met. Use the cross next to a condition to remove it again.
-
Save
Save the page or the template.
Available conditions
Section titled “Available conditions”The same conditions are available as for template pages:
- Project: yes / no — the property is a development project, or it is not.
- Reference object: yes / no — the property is a reference property, or it is not.
- Property content — the property has a certain content, such as images, floor plans, videos, downloadable documents, a location description, an energy certificate or a contact person.
- “Datenfeld hat einen Wert” (German label, not yet translated) — a data field of the property or its contact person is filled in, for example purchase price or living area.
- Property type, listing type, usage type, country, location, status, features — the property belongs to a certain term, for example “Property type: House”.
Which property is checked
Section titled “Which property is checked”- In a query loop, for example in the property cards of the archive template, WP-ImmoMakler checks each property individually. This way, for example, only the card of a property with a video gets a “Video” note.
- In the template for the detail view, the property being viewed applies.
- Outside a property, for example on a normal page, the conditions are not met. A block set to “show only if” stays hidden there, one set to “hide if” stays visible. The exception is the category conditions in the list view: there, the category being viewed counts, for example
/immobilien-arten/haus/.