Documentation

This is the technical documentation of the Yes-co ORES Wordpress plugin.
The documentation is writen in english because sometimes developers from outside the Netherlands are hired.

Introduction

To successfully integrate the plugin into your own theme you will (at least) need:

Multiple type of objects can be published to the Wordpress website:

Example theme

When implementing the Yes-co Real Estate Plugin into your own theme it’s recommended to take a good look at the Yes-co example theme. This example theme is not a nicely designed theme you could use (without any modifications) for your website, but should give you an insight on how to work with the Yes-co ORES plugin.

The most important files of the example theme are:

  • loop.php, overview of posts/objects
  • single-bedrijf.php, the detail page of a business object
  • single-huis.php, the detail page of a living object
  • single-yog-nbpr.php, the detail page of a new build project
  • single-yog-nbty.php, the detail page of a new build type
  • single-yog-bbpr.php, the detail page of a existing complex
  • single-yog-bbty.php, the detail page of a existing complex type

When you want to include a map with all your objects, the following files can be used as an example:

  • page-map-full.php, shows map with all the objects. Can be selected when creating a page in the wp-admin.
  • single-map-detail-window-huis.php, used to generate the object details when visitor clicks on pointer on the map.

For example: loop.php could look like this:

<?php
// Check if there are posts
if (have_posts())
{
	// Loop through the posts
	while (have_posts())
	{
		// Retrieve the current post
		the_post();

		// Determine the post type
		$postType = get_post_type();

		// Generate specific html for different types of posts
		switch ($postType)
		{
			case YOG_POST_TYPE_WONEN:	// BBvk / BBvh / NBvk
			case YOG_POST_TYPE_BOG:		// BOvk / BOvh
			case YOG_POST_TYPE_NBPR:	// NBpr
			case YOG_POST_TYPE_NBTY:	// NBty
			case YOG_POST_TYPE_BBPR:	// BBpr
			case YOG_POST_TYPE_BBTY:	// BBty
				// Specific code voor objects / projects.
				// above constants are defined by the plugin

				// Retrieve 1 specific specification of the object
				$type		= yog_retrieveSpec('Type');
				// Retrieve multiple specifications at once
				$specs	= yog_retrieveSpecs(array('Status', 'Type', 'HorecaType', 'BouwType'));
				// Retrieve prices
				$prices	= yog_retrievePrices();
				break;
			case 'page':
				// Specific code for pages
				break;
			default:
				// Specific code for normal posts
				break;
		}
	}
}
?>

Categories

Each object on the wordpress website is automatically linked to multiple categories. To create a list of objects you can just list all posts in a specific category. Each object can be linked to multiple categories.

When you don’t want to use the normal wordpress categories for your objects, there is an setting to use custom categories in the Yes-co ORES settings page in the WP admin. (If this option is set, the yog_category taxonomy will be used)

BBvk / BBvh / NBvk / NBvh categories

  • consument
    • bestaand
    • nieuwbouw
    • woonruimte
      • appartment
      • woonhuis
    • bouwgrond
    • ligplaats
    • parkeergelegenheid
    • standplaats
    • berging
    • onderstuk
    • opslagruimte
    • open-huis
    • verkoop
    • verhuur
    • verkochtverhuurd

BOvk / BOvh categories

  • bedrijf
    • bog-bouwgrond
    • bog-bestaand
    • bog-nieuwbouw
    • bog-verkoop
    • bog-verhuur
    • bog-verkochtverhuurd
    • bedrijfsruimte
    • horeca
    • kantoorruimte
    • winkelruimte
    • bog-bouwgrond
    • bog-garagebox
    • leisure
    • maatschappelijk-vastgoed
    • praktijkruimte
    • verhard-buitenterrein
    • bog-belegging

NBpr categories

  • nieuwbouw-projecten
    • nieuwbouw-project
      • nieuwbouw-project-verkoop
      • nieuwbouw-project-verhuur
      • nieuwbouw-project-verkochtverhuurd

NBty categories

  • nieuwbouw-projecten
    • nieuwbouw-type
      • nieuwbouw-type-verkoop
      • nieuwbouw-type-verhuur

NBbn categories (depricated)

  • nieuwbouw-projecten
    • nieuwbouw-bouwnummer
      • nieuwbouw-bouwnummer-verkochtverhuurd

BBpr categories

  • complexen
    • complex
      • complex-verkoop
      • complex-verhuur

BBty categories

  • complexen
    • complex-type
      • complex-type-verkoop
      • complex-type-verhuur

Custom categories

It’s also possible to add custom categories to objects when they are published to the Wordpress website. This can be done by adding a yog_plugin_get_categories and yog_plugin_register_new_categories function to the functions.php in the root of your theme directory.

The yog_plugin_register_new_categories function should return a list of categories that need to exist. All categories should be a sub-category of consument, woonruimte, bedrijf, nieuwbouw-projecten, nieuwbouw-type or nieuwbouw-bouwnummer. For example:

<?php
/**
* @desc Function yog_plugin_register_new_categories which allows the addition of more categories
*
* @param array $currentCategories
* @return array
*/
function yog_plugin_register_new_categories($currentCategories)
{
	$subcategories = array();

	// For example registering a senior specific category for projects
	$subcategories[$currentCategories['consument']] => array(
		'senioren' => 'Senioren'
	);

	return $subcategories;
}
?>

The yog_plugin_get_categories function should return an array of extra categories that needs to be linked to a specific object. The function receives an wrapper object containing a simpeXML object as a parameter. For example:

<?php
/**
* @desc Function yog_plugin_get_categories
*
* @param Yog3McpXmlProjectAbstract $mcp3Project
* @return array
*/
function yog_plugin_get_categories($mcp3Project)
{
	$categories = array();

	/* For example adding a senior specific category to projects */
	if ($mcp3Project instanceof Yog3McpXmlProjectWonen)
	{
		// Bijzonderheden
		$bijzonderheden = $mcp3Project->getStringByPath('
		//project:Details/project:Woonruimte/project:Diversen/project:Bijzonderheden/project:Bijzonderheid/@naam');
		if (!empty($bijzonderheden))
		{
			$bijzonderheden = explode(',', $bijzonderheden);

			foreach ($bijzonderheden as $bijzonderheid)
			{
				if (trim($bijzonderheid) == 'toegankelijk voor ouderen')
					$categories[] = 'senioren';
			}
		}
	}

  return $categories;
}
?>

The $mcp3Project parameter is an Yog3McpXmlProjectWonen, Yog3McpXmlProjectBog, Yog3McpXmlProjectNBpr, Yog3McpXmlProjectNBty or Yog3McpXmlProjectNBbn object. They all contain the following functions to get information from the SimpleXML with an xpath query:

  • array getNodesByXpath(string $xpath);
  • string getStringByPath(string $xpath);
  • int getIntByPath(string $xpath);
  • bool getBoolByPath(string $xpath);

The xsd’s of the object XML can be found with our 3mcp connector documentation. (Yes-co 3MCP 1.4 Specs package (.zip))

Available functions

For all functions where a $postId can be provided:
When the $postId is not provided, the function will use the current post as a default. (he_post() should be called before calling the function, otherwise there is no current post!)

yog_isObject

yog_isObject([int $postId]) : bool

Check whether a post is an object/project.

yog_getAddress

yog_getAddress([int $postId]) : string

Retrieve the address of an object.

yog_retrieveSpecs

yog_retrieveSpecs(array $specs [, int $postId [, bool $returnTitle]]) : array

Retrieve multiple specifications of an object at once. The available specifications can be found in the “available specifications” section.
The array returned contains all the requested specifications that have a value. When $returnTitle is not specified (or true) the specification title is used as a key. When $returnTitle is false, the specification key (as provided with $specs) is used as key.

For Example:

<?php
print_r(yog_retrieveSpecs(array('Status', 'Type'));
/*
array (
	[‘Status’] => ‘Beschikbaar’
);
*/
?>

yog_retrieveSpec

yog_retrieveSpec(string $spec [, int $postId]) : string

Retrieve one specific specification of an object. The available specifications can be found in the “available specifications” section.

yog_retrieveDateTimeSpec

yog_retrieveDateTimeSpec(string $spec [, int $postId]) : \DateTime or null

Retrieve a \DateTime object of a specific specification. Only the following specifications are supported:

  • OpenHuisVan
  • OpenHuisTot

yog_retrievePrices

yog_retrievePrices([string $priceTypeClass = 'priceType' [, string $priceConditionClass = 'priceCondition' [, int $postId [, $labelElem = ‘span’ [, $valueElem = ‘’]]]]]) : array

Retrieve the prices of an object.

For Example:

<?php
print_r(yog_retrievePrices(‘price’, ‘cond’));
/*
array (
  [0] => ‘<span class=”price”>Vraagprijs: </span> € 175.000,- <span class=”cond”>k.k.</span>’,
  [1] => ‘<span class=”price”>Huurprijs: </span> € 500,- <span class=”cond”>p.m.</span>’
);
*/

print_r(yog_retrievePrices(‘price’, ‘cond’, null, ‘div’, ‘div’));
/*
array (
  [0] => ‘<div class=”price”>Vraagprijs: </div> <div>€ 175.000,- <span class=”cond”>k.k.</span>’,
  [1] => ‘<div class=”price”>Huurprijs: </div> <div>€ 500,- <span class=”cond”>p.m.</span></div>’
);
*/

print_r(yog_retrievePrices(‘price’, ‘cond’, null, ‘’, ‘’));
/*
array (
  [0] => ‘Vraagprijs:  € 175.000,- <span class=”cond”>k.k.</span>’,
  [1] => ‘Huurprijs: € 500,- <span class=”cond”>p.m.</span>’
);
*/
?>

yog_hasParentObject

yog_hasParentObject([int $postId]) : bool

Check whether an object has got a parent object.

yog_getParentObjectId

yog_getParentObjectId([int $postId]) : mixed

Retrieve the post id of the parent object. When there is no parent object false will be returned.

yog_retrieveParentObject

yog_retrieveParentObject([int $postId]) : mixed

Retrieve the post of the parent object. When there is no parent object false will be returned, otherwise the corresponding WP_post object is returned.

yog_hasChildObjects

yog_hasChildObjects([int $postId]) : bool

Check whether an object has got child objects

yog_retrieveChildObjects

yog_retrieveChildObjects([int $postId]) : array

Retrieve array of child objects of an object. (Array contains WP_post objects)

yog_retrieveChildNBbnObjects (depricated)

yog_retrieveChildNBbnObjects([int $postId]) : array

Retrieve array of child NBbn objects. Is only useable for a NBty. Returns list of WP_Post objects.
Note: NBbn objects are not publishable to Tiara (NVM), so it might be better to show a list of NBvk/NBvh objects

yog_retrieveNbbnTable (depricated)

yog_retrieveNbbnTable([int $postId]) : string

Retrieve table with all the NBbn’s of a new build type. Is only useable for a NBty. Returns a string containing HTML table, or empty string (of no NBbn objects are found).
Note: NBbn objects are not publishable to Tiara (NVM), so it might be better to show a list of NBvk/NBvh objects.

yog_retrieveRelations

yog_retrieveRelations([int $postId]) : array

Retrieve array of linked relations. Returns array contains WP_Post objects

yog_retrieveRelationByRole

yog_retrieveRelationByRole(string $role [, int $postId]) : WP_Post or null

Retrieve a linked relation with a specific role. Returns WP_Post object or null.

Possible roles:

  • Makelaarskantoor
  • Makelaar 1
  • Binnendienst 1
  • Verkoper 1

yog_retrieveDocuments

yog_retrieveDocuments([int $postId]) : array

Retrieve array of (external) document links of an object. Returns an array with for each document link an array containing:

  • [uuid] => Universally unique identifier of document link
  • [order] => Order of document link
  • [title] => Title of document link
  • [type] => Type of document link
  • [url] => Url of document link

yog_retrieveMovies

yog_retrieveMovies([int $postId]) : array

Retrieve array with information about the movies of an object. Returns an array with for each movie an array containing:

  • [uuid] => Universally unique identifier of movie
  • [order] => Order of movie
  • [title] => Title of movie
  • [videostreamurl] => Url to video steam (if present)
  • [websiteurl] => Url of video
  • [videoereference_serviceuri] => URI of video hosting site (if present)
  • [videoereference_id] => ID of video on video hosting site (if present)

yog_retrieveEmbedMovies

yog_retrieveEmbedMovies([int $postId]) : array

Retrieve array with information about the movies, that can be embeded, of an object. Returns the same kind of array as yog_retrieveMovies().

yog_retrieveExternalMovies

yog_retrieveExternalMovies([int $postId]) : array

Retrieve array with information about the movies, that can not be embeded, of an object. Returns the same kind of array as yog_retrieveMovies().

yog_getMovieEmbedCode

yog_getMovieEmbedCode(array $movie, int $width, int $height [, $class]) : string

Retrieve HTML embed code of a specific movie, if possible. $movie should contain the movie information of a single movie (like returned by yog_retrieveMovies()).

yog_retrieveDossierItems

yog_retrieveDossierItems([int $limit [, int $postId]]) : array

Retrieve dossier items of an object. Returns an array with for each dossier item an array containing:

  • [url] => Url of dossier item
  • [title] => Title of dossier item
  • [mime_type] => Mime type of dossier item

yog_hasOpenHouse

yog_hasOpenHouse([int $postId]) : bool

Check whether an object has got an open house date

yog_getOpenHouse

yog_getOpenHouse([string $label = ‘Open huis’ [, int $postId]]) : string

Retrieve the open house date of an object.
For example:

<?php
echo yog_getOpenHouse();
// <span class="label">Open huis</span> 01-01-2014
?>

yog_retrieveMainImage

yog_retrieveMainImage(string $size [, int $postId]) : string

Retrieve the html tag of the main image of an object. $size should contain one of the registered sizes (like: thumbnail, medium or large).

yog_retrieveImages

yog_retrieveImages(string $size [, int $limit [, int $postId]]) : array

Retrieve information about the images/floorplans of an object. $size should contain one of the registered sizes (like: thumbnail, medium or large).
Returns an array with for each image an array containing:

  • [0] => url
  • [1] => width
  • [2] => height
  • [3] => boolean: true if $url is a resized image, false if it is the original.

yog_hasNormalImages

yog_hasNormalImages([int $postId]) : bool

Check if the object has normal images (images that are no floorplan).

yog_retrieveNormalImages

yog_retrieveNormalImages($size [, int $limit [, int $postId]]) : array

Retrieve information about the images (no floorplans) of an object. $size should contain one of the registered sizes (like: thumbnail, medium or large).
Returns an array with for each image an array containing:

  • [0] => url
  • [1] => width
  • [2] => height
  • [3] => boolean: true if $url is a resized image, false if it is the original.

yog_hasImagePlans

yog_hasImagePlans([int $postId]) : bool

Check if the object has floorplan images.

yog_retrieveImagePlans

yog_retrieveImagePlans($size [, int $limit [, int $postId]]) : array

Retrieve information about the floorplan images of an object. $size should contain one of the registered sizes (like: thumbnail, medium or large).
Returns an array with for each image an array containing:

  • [0] => url
  • [1] => width
  • [2] => height
  • [3] => boolean: true if $url is a resized image, false if it is the original.

yog_hasLocation

yog_hasLocation([int $postId]) : bool

Check if the geo location (latitude / longitude) of an object is set.

yog_retrieveStaticMap

yog_retrieveStaticMap([string $mapType = ‘hybrid’ [, int $zoomLevel = 18 [, int $width = 486 [, int $height = 400 [, int $postId]]]]]) : string

Retrieve static map (image tag) of geo location of an object. When no geo location is set an empty string is returned.

  • $mapType should be one of: roadmap, satellite, hybrid or terrain
  • $zoomLevel should be integer between 0 and 20
  • $width should be max 640

yog_retrieveDynamicMap

yog_retrieveDynamicMap([string $mapType = ‘hybrid’ [, int $zoomLevel - 18 [, int $width = 486 [, int $height = 400 [, string $extraAfterOnLoad [, bool $adminMode = false [, int $postId]]]]]]]) : string

Retrieve dynamic map (google maps) of the geo location of an object.

  • $mapType should be one of: roadmap, satellite, hybrid or terrain
  • $zoomLevel should be integer between 0 and 20
  • $extraAfterOnLoad extra javascript to execute onload
  • When $adminMode is set to true, the map will still be displayed when nog latitude / longitude are set. Also a draggable marker will be present.

yog_retrievePhotoSlider

yog_retrievePhotoSlider([string $largeImageSize = ‘large’ [, string $thumbnailSize = ‘thumbnail’ [, bool $scrollable = false [, mixed $type [, int $postId]]]]]) : string

Retrieve a photo slider element.

  • $largeImageSize should be one of: thumbnail, medium or large
  • $thumbnailSize should be one of: thumbnail, medium or large
  • $type should be: Plattegrond, Normaal or null

yog_getAllPostTypes

yog_getAllPostTypes() : array

Get all post types defined by the Yes-co Real Estate plugin.

yog_getAllObjectPostTypes

yog_getAllObjectPostTypes() : array

Get al the custom post types for objects defined by the Yes-co Real Estate plugin.

Available widgets

Yes-co Adres zoeken

A simple search form containing a single input field to search objects by address. It can also be used to search objects of a specific type.
When you want to change the html of this widget you can add a searchform-object.php template to your theme. The template shouldn't contain the form start/close tag.

Example searchform-object.php template:

<div>
  <label class="screen-reader-text" for="s">:</label>
  <input type="text" value="" name="s" id="s" />
  <input type="submit" id="searchsubmit" value="Submit" />
</div>

Yes-co Contact formulier

This contact form widget can be used to send customer response directly to the Yes-co system. The 'Response formulieren' app should be active in the linked Yes-co system.

Yes-co gelinkte objecten

Shows the linked objects of the active object (For example, shows all the NBty’s for a NBpr). Should be placed on a page with object details.

Yes-co gelinkte relaties

Shows the linked relations of the active object. Should be placed on a page with object details.
When you want to change the html of this widget you can add a object-relation.php template to your theme. If multiple relations are show, the template is used multiple times. The following usefull parameters are passed to the template:

  • $role
  • $relation (WP_Post object)
  • $type (type of relation)
  • $specs (specifications of relation)
  • $counter (number of relation shown)
  • $numRelations (total number of relations to show)

Example object-relation.php template:

<?php
if ($counter === 1)
	echo '<div class="row">';
?>
<div class="col-sm-6">
	<h5><?php echo $role;?></h5>
	<h6><?php echo get_the_title($relation->ID);?></h6>
</div>
<?php
if ($counter === $numRelations)
	echo '</div>';
?>

Yes-co Map

Shows a map based on a provided shortcode. The shortcode can be generated at the Yes-co ORES settings.

Yes-co Object koppelingen

Shows the links/documents/movies/dossier items of the active object. Should be placed on a page with object details.

Yes-co Recente objecten

Shows the newest objects. The number of objects shown can be configured.
When you want to change the html of this widget you can add a yesco/parts/recent-object.php template to your theme. If multiple objects are show, the template is used multiple times. The following usefull parameters are passed to the template:

  • $post (WP_Post object)
  • $limit (number of objects to show, set in widget settings)
  • groupTitleUsed (boolean, if a title for a group of objects should be shown)
  • groupTitle (string, the title for a group of objects)

Example yesco/parts/recent-object.php:

<?php
/**
 * Template for displaying recent object
 */
$postType     = get_post_type();
$title        = yog_retrieveSpec('Naam');
$city         = yog_retrieveSpec('Plaats');
$id           = get_the_ID();
$status       = yog_retrieveSpec('Status');

// Do not display prices for sold objects
if (!in_array(strtolower($status), array('verkocht', 'verhuurd')))
	$prices = yog_retrievePrices('hidden');
else
	$prices = null;

// Determine image url
$imageSize  = ($size >= 4) ? 'thumbnail-large' : 'thumbnail';
$images     = yog_retrieveImages($imageSize, 1, $id);
$imageUrl   = '';
if (!empty($images) && is_array($images) && count($images) > 0)
{
	$image    = $images[0];
	$imageUrl = $image[0];
}
?>
<article>
	<?php
	if (isset($groupTitleUsed) && $groupTitleUsed === true)
		echo '<div class="h3">' . (empty($groupTitle) ? ' ' : $groupTitle) . '</div>';
	?>
	<a href="<?php echo get_permalink();?>" title="<?php echo $title;?>">
		<div class="item-image-holder">
			<?php
			if (!empty($imageUrl))
				echo '<div class="item-image" style="background-image: url(' . $imageUrl . ');"></div>';
			else
				echo '<div class="item-no-image"></div>';
			?>
		</div>
		<div class="item-info">
			<strong><?php echo strtoupper($city);?></strong><br />
			<div class="ellipsis"><?php echo $title;?></div>
			<p class="ellipsis"><?php echo (empty($prices) ? ' ' : implode(' / ', $prices));?></p>
		</div>
	</a>
</article>
?>

To add extra content to the bottom of the widget, you can use the 'yog_recent_objects_widget_after' action. Example:

<?php
add_action('yog_recent_objects_widget_after', 'extendRecentObjectsWidget', 10, 1);
// $instance contains the settings of the widget
function extendRecentObjectsWidget($instance)
{
	echo 'Extra content of widget';
}
?>

To add extra settings to the widget (in the WP admin) you can use the 'yog_recent_objects_widget_after_settings' action. To save these extra settings you can use the 'yog_recent_objects_widget_update' filter. Example:

<?php
// Make sure the 4th param is set to 2, to make sure 2 arguments are passed to the extending functions
add_action('yog_recent_objects_widget_after_settings', 'extendRecentObjectsWidgetSettings', 10, 2);
add_filter('yog_recent_objects_widget_update', 'extendStoreRecentObjectsWidgetSettings', 10, 2);

/**
 * Show extra settings for the Yes-co ORES recent objects widget
* @param YogRecentObjectsWidget $widget
* @param array $instance (Widget settings)
* @return void
*/
function extendRecentObjectsWidgetSettings($widget, $instance)
{
	$buttonHref = empty($instance['button_href']) ? '' : $instance['button_href'];

	echo '<p>';
		echo '<label for="' . $widget->get_field_id('button_href') . '">Knop link:</label>';
		echo '<input class="widefat" type="url" name="' . $widget->get_field_name('button_href') . '" id="' . $widget->get_field_id('button_href') . '" value="' . $buttonHref . '" placeholder="http://" />';
	echo '</p>';
}


/**
 * Extend the storage of the Yes-co ORES recent objects widget
 * @param array $instance
 * @param array $new_instance
 * @return array
 */
function extendStoreRecentObjectsWidgetSettings($instance, $new_instance)
{
	$filterButtonHref = filter_var($new_instance['button_href'], FILTER_VALIDATE_URL);
	 $instance['button_href']  = ($filterButtonHref === false) ? '' : $filterButtonHref;
	 return $instance;
}
?>

Yes-co Objecten zoeken

Search form for BBvk/BBvh/NBvk/NBvh objects.

Yes-co BOG Objecten zoeken

Search form for BOvk/BOvh objects.

Yes-co Nieuwbouw Projecten zoeken

Search form for NBpr objects.

Yes-co Nieuwbouw Types zoeken

Search form for NBty objects.

Yes-co Complex zoeken

Search form for BBpr objects.

Shortcodes

yog-objects

A shortcode to display objects. supported parameters:

  • post_type, only retrieve object of a specific post type
    (use like [yog-objects post_type="bedrijf"])
  • num, limit the number of objects
    (use like [yog-objects num="4"])
  • cat, only retrieve objects of a specific category
    (use like [yog-objects cat="bog-verkoop"])
  • - template, the template to use to display the objects.
    The provided template should be available in the used theme with a file name object-[..].php.
    (use like [yog-objects template="highlight"] for using theme file object-highlight.php)

For example: the object-[..].php theme file could look like:

<?php
$postType     = get_post_type();
$title        = yog_retrieveSpec('Naam');
$city         = yog_retrieveSpec('Plaats');
$id           = get_the_ID();
$status       = yog_retrieveSpec('Status');

// Do not display prices for sold objects
if (!in_array(strtolower($status), array('verkocht', 'verhuurd')))
	$prices = yog_retrievePrices('hidden');
else
	$prices = null;

// Determine image url
$imageSize  = ($size >= 4) ? 'thumbnail-large' : 'thumbnail';
$images     = yog_retrieveImages($imageSize, 1, $id);
$imageUrl   = '';
if (!empty($images) && is_array($images) && count($images) > 0)
{
	$image    = $images[0];
	$imageUrl = $image[0];
}
?>
<article>
	<?php
	if (isset($groupTitleUsed) && $groupTitleUsed === true)
		echo '<div class="h3">' . (empty($groupTitle) ? ' ' : $groupTitle) . '</div>';
	?>
	<a href="<?php echo get_permalink();?>" title="<?php echo $title;?>">
		<div class="item-image-holder">
			<?php
			if (!empty($imageUrl))
				echo '<div class="item-image" style="background-image: url(' . $imageUrl . ');"></div>';
			else
				echo '<div class="item-no-image"></div>';
			?>
		</div>
		<div class="item-info">
			<strong><?php echo strtoupper($city);?></strong><br />
			<div class="ellipsis"><?php echo $title;?></div>
			<p class="ellipsis"><?php echo (empty($prices) ? ' ' : implode(' / ', $prices));?></p>
		</div>
	</a>
</article>
?>

Available specifications

The specs below can be retrieved by using the yog_retrieveSpec and yog_retrieveSpecs functions.
For Example:

<?php
print_r(yog_retrieveSpecs(array('Status', 'Type'));
/*
array (
	['Status']	=> 'Beschikbaar',
	['Type']	=> 'Woonruimte'
);
*/
echo yog_retrieveSpec('Status');
/*
Beschikbaar
*/
?>

BBvk / BBvh / NBvk / NBvh

General

All the BBvk / BBvh / NBvk / NBvh object can have the following specifications.
The specifications are stored as meta values with a name like huis_ + specification name (for example: huis_Type)

Specification Description
uuid Unique identifier of the object in the 3mcp feed
dlm Date last modified
scenario Scenario, for example: BBvk
Type Type of the object, for example: 'Woonruimte'
ApiKey API key of the object to use as a project_id with the Yes-co response API
Status Status, for example: beschikbaar
Naam Name, normally this contains the street and housenumber
Land Country
Provincie Province / State
Gemeente Municipality
Plaats City
Wijk Area
Buurt Neighbourhood
Straat Street
Huisnummer Housenumber, including the housenumber addition
HuisnummerNumeriek Housenumber, only the numeric part
HuisnummerToevoeging The housenumber addition
Postcode Zipcode
Longitude Longitude, to use with for example google maps
Latitude Latitude, to use with for example google maps
KoopPrijsSoort Type of sale price, for example: Vraagprijs
KoopPrijs Sale price
KoopPrijsConditie Sale price condition, for example: k.k.
KoopPrijsVervanging Replacement for the sale price, for example: Op aanvraag
Veilingdatum Auction date
HuurPrijs Rental price
HuurPrijsConditie Rental price condition, for example: p.m.
OpenHuisVan Date/time of the open house (start)
OpenHuisTot Date/time of the open house (end)
OppervlaktePerceel Parcel space
ZakelijkeRechten Rights in rem, for example: "BP rechten, recht van opstal"
Informatieplicht Information duty, for example: "asbest"
OzbGebruikersDeel OZB taxes for the user
OzbZakelijkeDeel OZB taxes for the owner
Waterschapslasten Taxes for the “waterschap”
Stookkosten Estimated heating costs
RuilverkavelingsRente Land consolidation Interest
Rioolrechten Sewerage charges
Eigendomsoort Type of ownership
ErfpachtPerJaar Yearly leasehold
ErfpachtDuur Duration of the leasehold
Servicekosten Service costs
Aanvaarding Acceptance
DatumVoorbehoudTot Date reservation ends

Extra specification for object of type 'Woonruimte'

Specification Description
PremieSubsidies Subsidy, for example: “Woningborg / SWK”
Bijzonderheden Details, for example: “beschermd stads- of dorpsgezicht”
Aantalkamers Number of rooms
AantalSlaapkamers Number of bedrooms
Oppervlakte Living surface
Inhoud Living volume
Woonkamer Type of the living room
Keuken Type of the kitchen
KeukenVernieuwd Year the kitchen was renewed
Ligging Location, for example: “aan bosrand”
GarageType Type of the garege
GarageCapaciteit Capacity (cars) of the garage
TuinType Type of garden
TuinTotaleOppervlakte Garden surface
HoofdTuinType Type of main garden
HoofdTuinTotaleOppervlakte Main garden surface
TuinLigging Location of the garden: for example: “Zuid”
BergingType Type of storage
PraktijkruimteType Type of practice space
PraktijkruimteMogelijk Type of practice space that’s possible
EnergielabelKlasse Energy label
HuidigGebruik Current usage
HuidigeBestemming Current destination
PermanenteBewoning Is permanent occupation allowed?
Recreatiewoning Is it a recreational object?
Verwarming Type of heating
WarmWater Type of system used for hot water
CvKetel Type of central heating system
CvKetelBouwjaar Build year of the central heating system
Isolatie Isolation
Dak Type of roof
DakMaterialen Materials used for the roof
OnderhoudBinnen State of the maintenance inside
OnderhoudBuiten State of the maintenance outside
Bouwjaar Build year
Voorzieningen Facilities, for example: “Airconditioning, Sauna”
SoortWoning Kind of object, for example: “eengezinswoning”
TypeWoning Type of object, for example: “tussenwoning”
KenmerkWoning Characteristic of the object, for example: “dijkwoning”

Extra specifications for object of type 'Bouwgrond'

Specification Description
Oppervlakte Surface
Ligging Location

Extra specifications for object of type 'Parkeergelegenheid'

Specification Description
Oppervlakte Surface

Extra specifications for object of type 'Berging'

Specification Description
Oppervlakte Surface

Extra specifications for object of type 'Standplaats'

Specification Description
Oppervlakte Surface

Extra specifications for object of type 'Ligplaats'

Specification Description
Oppervlakte Surface

BOvk / BOvh

General

All the BOvk/BOvh objects can have the following specifications.
The specifications are stored as meta values with a name like bedrijf_ + specification name (for example: bedrijf_Type)

Specification Description
uuid Unique identifier of the object in the 3mcp feed
dlm Date last modified
scenario Scenario, for example: BOvk
ApiKey API key of the object to use as a project_id with the Yes-co response API
Status Status, for example: beschikbaar
Naam Name, normally this contains the street and housenumber
BouwType “nieuwbouw” or “bestaande bouw”
Type Type of the object
Land Country
Provincie Province / State
Gemeente Municipality
Plaats City
Wijk Area
Buurt Neighbourhood
Straat Street
Huisnummer Housenumber, including the housenumber addition
HuisnummerNumeriek Housenumber, only the numeric part
HuisnummerToevoeging The housenumber addition
Postcode Zipcode
Longitude Longitude, to use with for example google maps
Latitude Latitude, to use with for example google maps
NummerreeksStart Start of the serie of numbers
NummerreeksEind End of the serie of numbers
Aanmelding Type of application, for instande: “in verkoop genomen”
KoopPrijs Sale price
KoopPrijsValuta Sale price currency
KoopPrijsBtwPercentage Sale price tax percentage
KoopPrijsBtwBelast Sale price tax charged
KoopPrijsConditie Sale price condition, for example: k.k.
KoopPrijsVervanging Replacement for the sale price, for example: Op aanvraag
Bouwrente Building interest
Veilingdatum Auction date
HuurPrijs Rental price
HuurPrijsValuta Rental price currency
HuurPrijsBtwPercentage Rental price tax percentage
HuurPrijsBtwBelast Rental price tax charged
HuurPrijsConditie Rental price condition, for example: p.m.
HuurPrijsVervanging Rental price replacement
Servicekosten Service costs
ServicekostenValuta Service costs currency
ServicekostenBtwPercentage Service costs tax percentage
ServicekostenBtwBelast Service costs tax charged
ServicekostenConditie Service costs condition
Erfpacht Leasehold
ErfpachtDuur Duration of the leasehold
PerceelOppervlakte Parcel space
AantalHuurders Number of tenants
Huuropbrengst Rental profit
HuuropbrengstValuta Rental profit currency
HuuropbrengstBtwPercentage Rental profit tax percentage
HuuropbrengstBtwBelast Rental profit tax charged
BeleggingExpiratieDatum Expiration date of the investment
Hoofdbestemming Main purpose
Nevenbestemming Secondary purpose
WoonruimteSituatie Situation of the living area
WoonruimteStatus Type of living area
Aanvaarding Acceptance
DatumVoorbehoudTot Date reservation ends

Extra specifications for object of type 'Bouwgrond'

Specification Description
BouwgrondBebouwingsmogelijkheid Development opportunity
BouwgrondBouwhoogte Max building height
BouwgrondInUnitsVanaf Units from
BouwgrondVloerOppervlakte Floor space
BouwgrondVloerOppervlakteProcentueel Floor space percentage

Extra specifications for building objects
Objects of type bedrijfsruimte, garagebox, horeca, kantooruimte, praktijkruimte, showroom and winkelruimte also have got the following specifications.

Specification Description
InAanbouw Under construction
OnderhoudBinnen Maintenance state inside
OnderhoudBinnenOmschrijving Maintenance state inside description
OnderhoudBuiten Maintenance state outside
OnderhoudBuitenOmschrijving Maintenance state outside description
LokatieOmschrijving Location description
Ligging Location
SnelwegAfrit Distance to motorway exit
NsStation Distance to NS station
NsVoorhalte Distance to NS ‘voorhalte’
BusKnooppunt Distance to bus junction
TramKnooppunt Distance to tram junction
MetroKnooppunt Distance to subway junction
Bushalte Distance to bus stop
Tramhalte Distance to tram stop
Metrohalte Distance to subway stop
BankAfstand Distance to bank
BankAantal Number of banks
OntspanningAfstand Distance to relaxation
OntspanningAantal Number of relaxation
RestaurantAfstand Distance to restaurant
RestaurantAantal Number of restaurants
WinkelAfstand Distance to shops
WinkelAantal Number of shops
ParkerenOmschrijving Parking description
AantalParkeerplaatsen Number of parking lots
AantalParkeerplaatsenOverdekt Number of covered parking lots
AantalParkeerplaatsenNietOverdekt Number of outdoor parking lots
Bouwjaar Build year

Extra specifications for object of type 'Bedrijfsruimte'
In addition to the general BOG specs and the BOG building objects specs, objects of type 'Bedrijfsruimte' also have got the following specifications.

Specification Description
BedrijfshalOppervlakte Industrial building; surface
BedrijfshalInUnitsVanaf Industrial building; in units from
BedrijfshalVrijeHoogte Industrial building; free height
BedrijfshalVrijeOverspanning Industrial building; free span
BedrijfshalVloerbelasting Industrial building; floor lood
BedrijfshalVoorzieningen Industrial building; facilities
BedrijfshalPrijs Industrial building; price
BedrijfshalPrijsValuta Industrial building; price currency
BedrijfshalPrijsBtwPercentage Industrial building; price tax percentage
BedrijfshalPrijsBtwBelast Industrial building; price tax charged
KantoorruimteOppervlakte Office; surface
KantoorruimteAantalVerdiepingen Office; number of floors
KantoorruimteVoorzieningen Office; facilities
KantoorruimtePrijs Office; price
KantoorruimtePrijsValuta Office; price currency
KantoorruimtePrijsBtwPercentage Office; price tax percentage
KantoorruimtePrijsBtwBelast Office; price tax charged
TerreinOppervlakte Terrain; surface
TerreinBouwvolumeBouwhoogte Terrain; possible building height
TerreinBouwvolumeVloerOppervlakte Terrain; possible building floor space
TerreinPrijs Terrain; price
TerreinPrijsValuta Terrain; price currency
TerreinPrijsBtwPercentage Terrain; price tax percentage
TerreinPrijsBtwBelast Terrain; price tax charged

Extra specifications for object of type 'Kantoorruimte'
In addition to the general BOG specs and the BOG building objects specs, objects of type 'Kantoorruimte' also have got the following specifications.

Specification Description
KantoorruimteOppervlakte Surface
KantoorruimteAantalVerdiepingen Number of floors
KantoorruimteVoorzieningen Facilities
KantoorruimteInUnitsVanaf In units from
KantoorruimteTurnKey Turnkey

Extra specifications for object of type 'Winkelruimte'
In addition to the general BOG specs and the BOG building objects specs, objects of type 'Winkelruimte' also have got the following specifications.

Specification Description
WinkelruimteOppervlakte Surface
WinkelruimteVerkoopVloerOppervlakte Sales floor area
WinkelruimteInUnitsVanaf In units from
WinkelruimteFrontBreedte Shopfront width
WinkelruimteAantalVerdiepingen Number of floors
WinkelruimteWelstandsklasse Social class
WinkelruimteBrancheBeperking Trade restriction
WinkelruimteHorecaToegestaan Catering allowed
WinkelruimteBijdrageWinkeliersvereniging Contribution retailers association
WinkelruimtePersoneelTerOvername Staff to take over
WinkelruimtePrijsInventarisGoodwill Price inventory/goodwill
WinkelruimtePrijsInventarisGoodwillValuta Price inventory/goodwill currency
WinkelruimtePrijsInventarisGoodwillBtwPercentage Price inventory/goodwill tax percentage
WinkelruimtePrijsInventarisGoodwillBtwBelast Price inventory/goodwill tax charged

Extra specifications for object of type 'Horeca'

In addition to the general BOG specs and the BOG building objects specs, objects of type 'Horeca' also have got the following specifications.

Specification Description
HorecaType Type of catering
HorecaOppervlakte Surface
HorecaVerkoopVloerOppervlakte Sales floor area
HorecaAantalVerdiepingen Number of floors
HorecaWelstandsklasse Social class
HorecaConcentratieGebied Concentration
HorecaRegio Region
HorecaPersoneelTerOvername Staff to take over
HorecaPrijsInventarisGoodwill Price inventory/goodwill
HorecaPrijsInventarisGoodwillValuta Price inventory/goodwill currency
HorecaPrijsInventarisGoodwillBtwPercentage Price inventory/goodwill tax percentage
HorecaPrijsInventarisGoodwillBtwBelast Price inventory/goodwill tax charged

NBpr

All specifications for NBpr projects.
The specifications are stored as meta values with a name like yog-nbpr_ + specification name (for example: yog-nbpr_Naam)

Specification Description
uuid Unique identifier of the object
dlm Date last modified
scenario Scenario, always NBpr
ApiKey API key of the object to use as a project_id with the Yes-co response API
Naam Name of the project
Land Country
Provincie Province / State
Gemeente Municipality
Plaats City
Wijk Area
Buurt Neighbourhood
Straat Street
Postcode Zipcode
Longitude Longitude, to use with for example google maps
Latitude Latitude, to use with for example google maps
KoopAanneemSomMin Min contract price
KoopAanneemSomMax Max contract price
HuurPrijsMin Min rental price
HuurPrijsMax Max rental price
HuurPrijsConditie Rental price condition, for example: p.m.
PerceelOppervlakteMin Min plot area
PerceelOppervlakteMax Max plot area
WoonOppervlakteMin Min living space
WoonOppervlakteMax Max living space
InhoudMin Min volume
InhoudMax Max volume
Fase Phase
Status State, for example: ‘in voorbereiding’
ProjectSoort Type of project, for example: ‘bouwplan’
AantalEenheden Number of units
StartBouw Start of construction
DatumStartBouw Start of construction date
Oplevering Delivery
DatumOplevering Delivery date

NBty

All specifications for NBty projects.
The specifications are stored as meta values with a name like yog-nbty_ + specification name (for example: yog-nbty_Naam).

Specification Description
uuid Unique identifier of the object
dlm Date last modified
scenario Scenario, always NBty
ApiKey API key of the object to use as a project_id with the Yes-co response API
Status State, for example: ‘beschikbaar’
Naam Name of the project
KoopPrijsMin Min sale price
KoopPrijsMax Max sale price
HuurPrijsMin Min rental price
HuurPrijsMax Max rental price
HuurPrijsConditie Rental price condition, for example: ‘p.m.’
PerceelOppervlakteMin Min plot area
PerceelOppervlakteMax Max plot area
WoonOppervlakteMin Min living space
WoonOppervlakteMax Max living space
InhoudMin Min volume
InhoudMax Max volume
AantalEenheden Number of units
AantalVrijeEenheden Number of free units
StartBouw Start of construction
DatumStartBouw Start of construction date
Oplevering Delivery
DatumOplevering Delivery date
PermanenteBewoning Is permanent occupation allowed?
Recreatiewoning Is it a recreational object?
Aantalkamers Number of rooms
GarageType Garage type
GarageCapaciteit Garage capacity
GarageVoorzieningen Garage facilities
GarageIsolatievormen Garage isolation type(s)
TuinType Garden type
TuinTotaleOppervlakte Garden total surface
HoofdTuinType Main garden type
HoofdTuinDiepte Main garden depth
HoofdTuinBreedte Main garden width
HoofdTuinTotaleOppervlakte Main garden surface
TuinLigging Garden location (south, north, etc)
HoofdTuinAchterom Main garden gate
BergingType Storage type
BergingVoorzieningen Storage facilities
BergingIsolatievormen Storage isolcation type
Verwarming Heating
WarmWater Type of system used for hot water
CvKetel Type of central heating system
CvKetelBouwjaar Build year of the central heating system
CvKetelBrandstof Fuel of the central heating system
CvKetelEigendom Ownershop of the central heating system
CvCombiketel Combi boiler
Dak Roof type
DakMaterialen Roof material
Type Type, for example: “Woonhuis”
SoortWoning Kind of object, for example: “eengezinswoning”
TypeWoning Type of object, for example: “tussenwoning”
KenmerkWoning Characteristic of the object, for example: “dijkwoning”

BBpr

All specifications for BBpr projects.
The specifications are stored as meta values with a name like yog-bbpr_ + specification name (for example: yog-bbpr_Naam).

Specification Description
uuid Unique identifier of the object
dlm Date last modified
scenario Scenario, always BBpr
ApiKey API key of the object to use as a project_id with the Yes-co response API
Naam Name of the project
Land Country
Provincie Province / State
Gemeente Municipality
Plaats City
Wijk Area
Buurt Neighbourhood
Straat Street
Postcode Zipcode
Longitude Longitude, to use with for example google maps
Latitude Latitude, to use with for example google maps
KoopPrijsMin Min price
KoopPrijsMax Max price
HuurPrijsMin Min rental price
HuurPrijsMax Max rental price
HuurPrijsConditie Rental price condition, for example: p.m.
PerceelOppervlakteMin Min plot area
PerceelOppervlakteMax Max plot area
WoonOppervlakteMin Min living space
WoonOppervlakteMax Max living space
InhoudMin Min volume
InhoudMax Max volume

BBty

All specifications for BBty projects.
The specifications are stored as meta values with a name like yog-bbty_ + specification name (for example: yog-bbty_Naam).

Specification Description
uuid Unique identifier of the object
dlm Date last modified
scenario Scenario, always BBty
ApiKey API key of the object to use as a project_id with the Yes-co response API
Naam Name of the project
KoopPrijsMin Min sale price
KoopPrijsMax Max sale price
HuurPrijsMin Min rental price
HuurPrijsMax Max rental price
HuurPrijsConditie Rental price condition, for example: ‘p.m.’
PerceelOppervlakteMin Min plot area
PerceelOppervlakteMax Max plot area
WoonOppervlakteMin Min living space
WoonOppervlakteMax Max living space
InhoudMin Min volume
InhoudMax Max volume
PermanenteBewoning Is permanent occupation allowed?
Recreatiewoning Is it a recreational object?
Aantalkamers Number of rooms
GarageType Garage type
GarageCapaciteit Garage capacity
GarageVoorzieningen Garage facilities
GarageIsolatievormen Garage isolation type(s)
TuinType Garden type
TuinTotaleOppervlakte Garden total surface
HoofdTuinType Main garden type
HoofdTuinDiepte Main garden depth
HoofdTuinBreedte Main garden width
HoofdTuinTotaleOppervlakte Main garden surface
TuinLigging Garden location (south, north, etc)
HoofdTuinAchterom Main garden gate
BergingType Storage type
BergingVoorzieningen Storage facilities
BergingIsolatievormen Storage isolcation type
Verwarming Heating
WarmWater Type of system used for hot water
CvKetel Type of central heating system
CvKetelBouwjaar Build year of the central heating system
CvKetelBrandstof Fuel of the central heating system
CvKetelEigendom Ownershop of the central heating system
CvCombiketel Combi boiler
Dak Roof type
DakMaterialen Roof material
Type Type, for example: “Woonhuis”
SoortWoning Kind of object, for example: “eengezinswoning”
TypeWoning Type of object, for example: “tussenwoning”
KenmerkWoning Characteristic of the object, for example: “dijkwoning”

Synchronizing objects

Normal method (callback)

Synchronizing the objects with a callback is the default method. When an object is published a callback to the website is called. The callback retrieves a feed with all the published objects and checks if the objects in the wordpress database needs to be updated.
To avoid problems in the synchronisation the following actions can be taken:

  • Make sure Imagick is installed on the server (otherwise GD will be used)
  • Make sure php isn’t run in safe_mode, so the script can overwrite the time limit. If you do use safe_mode, make sure the max_execution_time is high enough.

CLI method

It’s also possible to run a WP Cli command to run the synchronisation. To do this you need to:

  • Make sure WP Cli is installed
  • Run the command “wp yog synchronize” in the public html folder of the website.

Example code

Show different widgets in search result for Living/BOG

<?php
if (function_exists('dynamic_sidebar') && isset($_GET['object_type']) && defined('YOG_POST_TYPE_WONEN'))
{
  switch ($_GET['object_type'])
  {
    case YOG_POST_TYPE_WONEN:
      dynamic_sidebar('Zoekresultaten - Wonen');
      break;
    case YOG_POST_TYPE_BOG:
      dynamic_sidebar('Zoekresultaten - BOG');
      break;
    case YOG_POST_TYPE_NBPR:
      dynamic_sidebar('Zoekresultaten - Nieuwbouw projecten');
      break;
    case YOG_POST_TYPE_NBTY:
      dynamic_sidebar('Zoekresultaten - Nieuwbouw types');
      break;
  }
}
?>

Notes:

  • Do not forget to register sidebars with register_sidebar()
  • If you check constants registered by the Yes-co ORES plugin, make sure the plugin is active (the example codes checks if YOG_POST_TYPE_WONEN is defined)