Skip to main content

Use Collection and Profile Components to Display Content Dynamically

Sometimes you want to highlight a series of pages on your site by displaying a title, a blurb (to let the user know what they can expect when they go to a page), and a link for each page in the series. You can use collection components to automate this process.

We offer collection components for pages, articles, contacts, and student and/or faculty profiles (to see a full list, check out the components page). Just add one of these components to a template, then apply a corresponding label to any page you want to display in the component.

The label should follow the format {page-slug}-{component-name}. The page slug is the last part of the URL of the page on which the component displays. For example, if the URL of your page is https://mywebsite.wvu.edu/my-subsection/my-page, the slug is my-page. The component name is the name of the component, including its instance number e.g. page-collection-1. In this case, if you wanted to display a collection of pages on the page my-page, you would use the label my-page-page-collection-1.

If you’re unsure what label to apply to your pages to get them to display, no worries. When viewing the page that houses your collection component in Edit Mode, find your component. A warning message will display if no pages are labeled, and tell you what label to use.

Custom Labels

If you don’t want to use the default label to pull content into a collection component, you can provide a name that is easier to understand.

  1. If you’re using a standard template, go into the page properties and enter your custom label into the field that corresponds to your component. For example, if you’re using the frontpage template, there is a field labelled “Custom Labels for Page Collection” that corresponds to the page collection component in that template. You might want to feature important pages in this component, in which case you might use a custom label of home-featured-pages. Enter that label and save your page properties. Now you can use that label to pull in pages.
  2. If you’re using the Super Template, go to the page properties of the page that contains your component, click the Slots tab, find the slot that contains your component, and enter your label into the “Custom Labels” field, then save the page properties.
Note: If you assign a custom label to a component, you should first add this label to any pages that were pulled into the component prior to assigning the custom label (assuming you want to keep them pulled in). Only one label can be used to feed content into a collection component.