Skip to main content
  • Home
  • Blog
  • Adding Default Content to All Pages in Your Site

Adding Default Content to All Pages in Your Site

|

We recently implemented a way to include 'default content' on all of your pages. Let's say, for example, that you want to include a Featurettes component at the bottom of all of your site's pages just above the footer with links to "Apply," "Visit," and "Request Info." Now you can do this for a subset of our design components without having to add the component manually to every page.

If your site uses the WVU Design System: Version 2.0 theme, or your theme is based on version 2.1.2 (check your theme's package.json file), you can use this feature. If not, see the following commits:

How It Works

In order to make this work, follow these steps:

  1. Create a new page in your site using the new Default Content template. Make sure to hide the page from nav and search engines in the page properties.
  2. Go into the page properties of this page, navigate to the Slots tab, then select and configure the component you want in each slot. You can add up to 3 components. Note that each component is set to sitewide i.e. scope: site by default.
  3. Make sure that each component's Instance Number and sitewide options do not conflict with other components on your site. For example, if you're using an Action Hero component as one of your default content components, and it's instance number is set to 1 and it's sitewide option is checked, and you have the same component with the same parameters set elsewhere on your site, this will cause a conflict. The simplest way to fix this is to simply change the instance number of the default content component.
  4. Note the page ID for your default content page.
  5. In your site settings, paste the page ID for your default content page in the default_content_page_id field, then save the settings.
  6. The components you configured for your default content page should now show above the footer on every page in your site.