JReviews logo Docs
Menu
Version

template_directory:after-directory{-name}

Action executed after each directory in a directory page.

Action
Templates
Since 3.7.4

You need to have a working knowledge of Hooks before you get started.

The {-name} tag allows the hook to run on the specified directory name without having to write conditions. You can find the directory name in the JReviews Directories Manager. The following variations are allowed:

  • template_directory:after-directory - runs for all directories
  • template_directory:after-directory-city-guide - runs on the city-guide directory

Parameters

Name Type Description
$directory parameter (array)
$instance parameter (MyView) instance of current view class

Boilerplate Code

Use the boilerplate code to start using the action, and add your own logic or echo output.

Clickfwd\Hook\Action::add('template_directory-after-directory-name', function($directory, $instance)
{
    // Execute action or echo output
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Examples

Most recent listings below directory page using shortcodes

Clickfwd\Hook\Action::add('template_directory:after-directory', function($directory)
{
	$dirId = $directory['Directory']['dir_id'];
	$title = $directory['Directory']['title'];
	?>
	<h2>Most recent in <?php echo $title; ?></h2>

	[jreviews type="listings" 
		dir="<?php echo $dirId; ?>" 
		listing_order="rdate" 
		themelayout="postcard" 
		orientation="native-scroll" 
		limit="10"
	]
	<?php
}, 10);

Source Files

  • /views/themes/default/directories/directory.thtml