CMS: About Dynamic Page URLs

5 min read
Recommended reading before beginning: 
The content for your site is stored in a collection and you want to use a dynamic page to display it. But if the page doesn't include the content, how does the page "know" what content to display? The content that a dynamic page displays is determined by the URL you define when you create the page. The URL also controls whether the page is an item page or a list page by controlling how many items your page can display.

Dynamic item pages

Let's say you have a recipes site named my-recipes and you want to create a dynamic item page that displays each one of your recipes. To do that, you need a URL that will be unique for each recipe in your collection. That way, each time the item page is displayed for each recipe, the page will "know" what content to show. You also need to make sure that the content in that field is unique, so that multiple items do not end up with the same URL.

You used the default Title field in the collection to store the names of your recipes. You can now use this field to make the URL for your item pages unique.

When you create your dynamic item page, the name of your collection is added to your URL automatically, as well as the default Title field.
 
Let's assume you keep these defaults. This URL is made up of both dynamic and static sections. The static sections appear as plain text, and the dynamic sections are highlighted. Let's look at the dynamic sections first.

Dynamic URL sections

The dynamic sections of the URL control which content your dynamic page displays, and they change depending on that content. When you create the dynamic item page URL, it looks like this:

If you click in the URL as you are creating it, you will see that it looks like this:

Notice that the dynamic section Title is surrounded by curly braces { }. This indicates that the word Title never actually appears in your URL. It's only a placeholder for the actual section that will be part of your URL. Every item in your collection can be displayed by this dynamic page. The {Title} section will be replaced in the page URL with the actual content of the Title field for the specific item the page is displaying at that time.

For example, the URL for the dynamic item page in your published site for the pizza recipe is: https://domain.com/recipes/pizza.

And the URL for the dynamic item page in your published site for the hamburger recipe is: https://domain.com/recipes/hamburger.

As you can see, the URL for both pages in your published site starts with the same sections: https://domain.com/recipes/. It's only the dynamic part that follows /recipes that is different for each page. 

The dynamic section of the URL is not case-sensitive. If you have two recipes for pizza, one called "pizza" and the other "Pizza," only one of them will be displayed in your dynamic page.
Note:
The examples in this article use premium site URLs. To learn more about the difference between premium site URLs and free site URLs, see About the URL Structure of Premium and Free Sites.

Static URL sections

The static sections of the URL are static because they are included in the URL for your dynamic page regardless of what content it is displaying. Whether your dynamic page is displaying your pizza recipe or your ice cream recipe, the URL for either page will start with https://domain.com/recipes.

When you create your URL, these static sections are represented by http://www.../recipes/. Unlike the dynamic section of the URL, the static sections are case-sensitive.

Dynamic list pages

In our example, you want to create a dynamic list page that displays all your recipes based on which meal they are served in. To do that, you need a URL that will be unique for each group of recipes that match a particular meal. That way, each time the list page is displayed for each group, the page will "know" what content to display.

When you create your dynamic list page, by default it doesn't contain any of your collection's fields. To set it up to display your recipes grouped by meal, you would add the meal field to your URL.
This URL is made up of both dynamic and static sections. The static sections appear as plain text and the dynamic sections are highlighted. Let's look at the dynamic sections first.

Dynamic URL sections

When you create your dynamic list page URL, you are creating a URL where the meal part will be replaced with the content of the meal field for any of the items in your collection.

When you click on the URL to edit it, it looks like this:
Here, too, the dynamic section meal is surrounded by { }. This indicates that the word meal never actually appears in your URL. It's only a placeholder for the actual section that will be part of your URL. Every category in your collection based on the meal field can be displayed by this dynamic page, and the {meal} section will be replaced in the page URL with the actual content of the meal field for the specific item.

For example, the URL for the dynamic list page in your published site for all your breakfast recipes is: https://domain.com/recipes/breakfast

And the URL for the dynamic list page in your published site for all your lunch recipes is: https://domain.com/recipes/lunch

Just like with the item page, the URL for both pages starts with the same sections: https://domain.com/recipes/

It's only the part that follows the /recipes that is different for each page.  

For dynamic list pages, the dynamic section of the URL is case-sensitive. So, unlike the dynamic item page, if you have two meals for lunch – one called "lunch" and the other "Lunch" – both of them will be displayed on your dynamic list page.

Static URL sections

The static sections of the URL are static because they are included in the URL for your Dynamic Page regardless of what content it is displaying. Whether your Dynamic Page is displaying your lunch recipes or your dinner recipes, the URL for either page will start with
 
https://domain.com/recipes.

When you create your URL, these static sections are represented by http://www.../recipes/. The static sections are case-sensitive.
Want to learn more?
To find out about dynamic page URLs, see the following articles:

Did this help?

|