Using the Express Entry Block to Output Entry Data

Once you've created your Express entries and associated them with each other, you'll want to use this information on the front-end of your website. Let's take our current example, Marinas and Boats. We have pages for each marina, and we'd like to show all the boats moored at each marina on those pages.

Here's how we'll accomplish our goal

  1. First, we'll create a custom page attribute that ties each Marina entry to its associated page on the front-end.
  2. Next, we'll add an Express Entry Detail block to each page, and configure it to pull from the current page's express custom attribute.
  3. Then, we'll create a custom template for the block, that takes the current page's express entry, grabs the related boats for that entry, and prints out their relevant data on the page.


If you'd like to watch a video that goes through all of this in detail, here it is:


First, you'll want to create an Express Entity page attribute, like this:

Then, apply the attribute to each page on the front-end:

Detail Block

Add an Express Detail block to the marina page in question. Configure it to pull from the current page's custom attribute:

Custom Template

Finally, we'll create a custom template, and apply it to the instance of the block. Learn more about custom block view templates here.. Here's what our custom template looks like:

<?php defined('C5_EXECUTE') or die("Access Denied."); ?>

if (isset($entry) && is_object($entry)) {

$boats = $entry->getBoats();


<table class="table">
    <?php if (count($boats)) {
        foreach($boats as $boat) { ?>
        <?php } ?>
    <?php } else { ?>
            <td colspan="4">No boats found.</td>
    <?php } ?>

<?php } ?>

This should be pretty straightfoward. Our Express entry doesn't have a getBoats() method on it, and the boat express entry doesn't have methods for getBoatClass(), getBoatYear(), etc.... But the Concrete\Core\Entity\Express\Entry object does have a magic method that will detect whether the method you're calling matches a current custom attribute handle, or an association handle. That way, we have a nice, dynamic API for working with our Express entity objects.