Group

Groups of fields

A group of external links with a label for each link:

Copy
      "relatedlinks" : {
  "type" : "Group",
  "fieldset" : "Related resources",
  "config" : {
    "fields" : {
      "label" : {
        "type" : "Text",
        "config" : {
          "placeholder" : "Link label"
        }
      },
      "link" : {
        "type" : "Link",
        "config" : {
          "select" : "web"
        }
      }
    }
  }
}
    

Reference

type

string

Group

fieldset

string

a user-friendly field label

config

object

objects listed below

config

fields

object

fields with their optional configuration as defined in the fields reference

repeat

Boolean

true or false, useful when Group is used as a Slices choice

Copy
      api.query([
    prismic.Predicates.at("document.type", "blog-post"),
    prismic.Predicates.at("my.blog-post.references.label", "crockford")
  ], { pageSize : 10 }).then(function(documents) {
  res.render('index', {
    prismicdoc: documents.results[0]
  })
});

    
Copy
      $response = $api->query(array(
    Predicates::at("document.type", "blog-post"),
    Predicates::at("my.blog-post.references.label", "crockford")
));
    
Copy
      Response response = api.query(
    Predicates.at("document.type", "blog-post"),
    Predicates.at("my.blog-post.references.label", "crockford")
).submit();
    
Copy
      ul
  each item in prismicdoc.getGroup('blog-post.references').toArray()
    li
      a(href=item.getLink("link").url())
        != item.getText("label")
    
Copy
      <ul>
<? foreach($prismicdoc->getGroup('blog-post.references')->getArray() as $item) { ?>
  <li>
    <a href="<?= $item->getLink("link")->getUrl() ?>"><?= $item->getText("label") ?></a>
  </li>
<? } ?>
</ul>
    
Copy
      <ul>
<c:forEach items="prismicdoc.getGroup("blog-post.references")->getDocs()" var="item">
  <li>
    <a href="${item.getLink("link").getUrl()}">${item.getText("label").getValue()}</a>
  </li>
</c:forEach>