diff --git a/src/Plugin/Field/FieldFormatter/CollectDataFormatter.php b/src/Plugin/Field/FieldFormatter/CollectDataFormatter.php
index 44ac5ae..6f59b4e 100644
--- a/src/Plugin/Field/FieldFormatter/CollectDataFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/CollectDataFormatter.php
@@ -107,7 +107,7 @@ class CollectDataFormatter extends FormatterBase implements ContainerFactoryPlug
           // If schema plugin has custom build method, use it to build the
           // output.
           $elements[$delta]['plugin']['#title'] = $this->t('Specialized display');
-          $elements[$delta]['plugin']['data'] = $schema_plugin->build($schema_plugin->parse($item));
+          $elements[$delta]['plugin']['data'] = $schema_plugin->build($schema_plugin->parse($item), $item->getEntity());
         }
         else {
           // If there is no custom build method, build a simple table of the
diff --git a/src/Plugin/collect/Schema/FetchUrlSchema.php b/src/Plugin/collect/Schema/FetchUrlSchema.php
index 525eb91..61f2461 100644
--- a/src/Plugin/collect/Schema/FetchUrlSchema.php
+++ b/src/Plugin/collect/Schema/FetchUrlSchema.php
@@ -6,6 +6,7 @@
 
 namespace Drupal\collect\Plugin\collect\Schema;
 
+use Drupal\collect\CollectContainerInterface;
 use Drupal\collect\Plugin\Field\FieldType\CollectDataItem;
 use Drupal\collect\Schema\SpecializedDisplaySchemaInterface;
 use Drupal\collect\Schema\SchemaBase;
@@ -43,7 +44,7 @@ class FetchUrlSchema extends SchemaBase implements SpecializedDisplaySchemaInter
   /**
    * {@inheritdoc}
    */
-  public function build($data) {
+  public function build($data, CollectContainerInterface $collect_container) {
     if (empty($data)) {
       return;
     }
@@ -96,9 +97,7 @@ class FetchUrlSchema extends SchemaBase implements SpecializedDisplaySchemaInter
     }
 
     // The response body.
-    $current_url = explode('/', \Drupal::requestStack()->getCurrentRequest()->getRequestUri());
-    $collect_container_id = end($current_url);
-    $url = \Drupal::url('collect.generate_page', ['collect_container' => $collect_container_id], ['absolute' => TRUE]);
+    $url = \Drupal::url('collect.generate_page', ['collect_container' => $collect_container->id()], ['absolute' => TRUE]);
     $output['body'] = array(
       '#type' => 'link',
       '#attributes' => array(
diff --git a/src/Plugin/collect/Schema/FieldDefinitionSchema.php b/src/Plugin/collect/Schema/FieldDefinitionSchema.php
index 5f5947e..b27f960 100644
--- a/src/Plugin/collect/Schema/FieldDefinitionSchema.php
+++ b/src/Plugin/collect/Schema/FieldDefinitionSchema.php
@@ -6,6 +6,7 @@
 
 namespace Drupal\collect\Plugin\collect\Schema;
 
+use Drupal\collect\CollectContainerInterface;
 use Drupal\collect\Plugin\Field\FieldType\CollectDataItem;
 use Drupal\collect\Schema\SpecializedDisplaySchemaInterface;
 use Drupal\collect\Schema\SchemaBase;
@@ -70,7 +71,7 @@ class FieldDefinitionSchema extends SchemaBase implements SpecializedDisplaySche
   /**
    * {@inheritdoc}
    */
-  public function build($definition) {
+  public function build($definition, CollectContainerInterface $collect_container) {
     $output = array();
     foreach ($definition['fields'] as $id => $value) {
       $output['fields'][$id] = array(
diff --git a/src/Schema/SpecializedDisplaySchemaInterface.php b/src/Schema/SpecializedDisplaySchemaInterface.php
index cb055cd..e3d5e4e 100644
--- a/src/Schema/SpecializedDisplaySchemaInterface.php
+++ b/src/Schema/SpecializedDisplaySchemaInterface.php
@@ -5,6 +5,7 @@
  */
 
 namespace Drupal\collect\Schema;
+use Drupal\collect\CollectContainerInterface;
 
 /**
  * Defines methods for schema plugins that have special display code.
@@ -16,10 +17,12 @@ interface SpecializedDisplaySchemaInterface extends SchemaInterface {
    *
    * @param mixed $data
    *   Any parsed data having this schema.
+   * @param \Drupal\collect\CollectContainerInterface $collect_container
+   *   A collect container object.
    *
    * @return array
    *   A renderable array representing the content.
    */
-  public function build($data);
+  public function build($data, CollectContainerInterface $collect_container);
 
 }
diff --git a/src/Tests/CollectWebTest.php b/src/Tests/CollectWebTest.php
index bc21bb5..4f6f259 100644
--- a/src/Tests/CollectWebTest.php
+++ b/src/Tests/CollectWebTest.php
@@ -123,6 +123,19 @@ class CollectWebTest extends WebTestBase {
     $this->assertNoLink($web_page_container->getOriginUri());
     $this->clickLink(t('2'));
     $this->assertResponse(200);
+
+    // Apply Fetch URL schema plugin.
+    // Assert a generated web page is accessible.
+    $this->clickLink(t('Set up a Collect Fetch URL schema'));
+    $this->drupalPostForm(NULL, [
+      'id' => 'collect_fetch_url',
+    ], t('Save'));
+    $this->clickLink(t('Show content in a new window'));
+    $this->assertResponse(200);
+    $this->drupalGet('admin/content/collect');
+    $this->clickLink(t('View'));
+    $this->clickLink(t('Show content in a new window'));
+    $this->assertResponse(200);
   }
 
   /**
diff --git a/tests/modules/collect_test/src/Plugin/collect/Schema/TestSpecializedDisplaySchema.php b/tests/modules/collect_test/src/Plugin/collect/Schema/TestSpecializedDisplaySchema.php
index fe7f7bd..cdf1f0e 100644
--- a/tests/modules/collect_test/src/Plugin/collect/Schema/TestSpecializedDisplaySchema.php
+++ b/tests/modules/collect_test/src/Plugin/collect/Schema/TestSpecializedDisplaySchema.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\collect_test\Plugin\collect\Schema;
 
+use Drupal\collect\CollectContainerInterface;
 use Drupal\collect\Schema\SpecializedDisplaySchemaInterface;
 
 /**
@@ -25,7 +26,7 @@ class TestSpecializedDisplaySchema extends TestSchema implements SpecializedDisp
   /**
    * {@inheritdoc}
    */
-  public function build($data) {
+  public function build($data, CollectContainerInterface $collect_container) {
     return array(
       '#type' => 'item',
       '#markup' => "Let me say " . $data['greeting'],
