Page Templates in Dynamics 365 are like empty houses. During my sixth-grade summer, I remember moving into a different house across town. Looking at the new residence without any furniture or other belongings made it appear so big and vacant, and I wondered how we would fit all of our stuff inside and not have huge empty spaces. Boy, was I naive. We filled it up quickly and pondered all the numerous ways to squeeze it all in.
Empty houses have all the rooms in place with their measurements, openings, and features. Unless you remodel, you can’t do anything about that. The only thing you can do is determine the location of the couch, the table, the bookshelves, etc.
Page Templates in Dynamics 365 are the house, and the web content is the furniture. You determine what content goes in each room and how much, and the Page Template ensures that no Web Page “walls” are broken in the process.
There are many different styles of homes. There are ranch-style houses, colonial-style houses, condos, modern, and even the hottest trend of tiny houses at a whopping 400 square feet. You can also have a wide range of Page Templates. You can create one-column, two-column, and three-column Page Templates – all with varying widths. You can create Page Templates that will support an image gallery or highlight specific sections of the Web Page.
This blog will not cover a large breadth of material but will hopefully bring enlightenment to these areas:
- Page Template Purpose
- Rewrite vs Web Template
- Web Templates
- Using Website Header and Footer
Purpose of Page Templates in Dynamics 365
Page Templates provide the Portal developer the ability to focus on content and types of pages and to avoid worrying about exactly how it will look and feel once it’s displayed on the web.
When it comes to web development, it’s guaranteed you will need different types of pages to handle your various needs. For example, you want to display a list of data that has several columns; here you will need a one-column layout. On the other hand, possibly for your homepage, you want to display a myriad of information, none of it huge, but you want to keep it separated; here you might want to use a three-column layout with the two side columns of equal length and the middle column taking up 50% of the total width.
Once all of your Page Templates (rooms in the house) are created, you only have to determine the template for your Web Pages (decide where the furniture goes).
Check out PureCSS to get a better idea of various layouts and their purposes.
Rewrite vs Web Template
Page Templates fall into two different camps: those that use an ASPX page, and those that use Web Template liquid code.
List of Page Templates:
Notice that some Page Templates have a value for “Rewrite URL” and some do not. Out of 28 default Page Templates, 17 of them are of a Type “Rewrite” that tap into an ASPX page, and the remaining ones are of Type “Web Template” that tap in Web Template liquid code.
Page Template with a “Rewrite URL”:
Page Template without it:
Without going into great detail, the “Rewrite URL” signifies that that particular Page Template is using a backend, unreachable ASPX page. The majority of these are used for specific purposes and cannot be used by your own custom Web Pages. For example, there is an Access Denied Page Template that displays when an unauthorized user attempts to access a Web Page of which they do not have the correct privileges. The other set of Page Templates utilize Web Templates which will be discussed next.
The majority of your Portal development will evolve around utilizing Web Pages that use Page Templates that are of Type “Web Template.”
These Page Templates use – you guessed it – Web Templates. Web Templates are part of Chapter 2 – Web Templates. Right now, suffice it to say that you can access Web Template liquid code and have the option to modify if necessary.
Let’s take a step back and look at the bigger picture:
A Web Page can display an Entity List, Entity Form, or Web Form; it can also display a custom page, but we will cover that at a different time. You can have three different styles of Web Pages that all use the same Page Template. The “room” can be a bedroom, an office, or a nursery; the room stays the same, but the contents can be different or positioned differently.
Let’s take a look at some differences in the Page Templates. Full Page without Child Links Page Template:
Here you can see the Contact form taking up the majority of horizontal space and is center aligned.
Page with Side Navigation (2 columns) Page Template:
For whatever reason, the supporting Web Template was missing from the out-of-the-box list of Page Templates and resulted in a blank area as seen above.
I had to create a new Web Template and named it “Layout 2 Column Wide Right”. After saving and refreshing, the page now shows properly.
In the blank area to the left, you can add your own text by editing the Page Copy through the Portal Content Editor.
The default Page Template options are fairly thin, but that doesn’t stop you from creating your own selection of Page Templates to meet the various Portal requirements.
Use Website Header and Footer
This most likely will only surface if you decide to create your own Page Templates, but why would we do this? Great question – I’m glad you asked. I’m sure there are dozens of reasons to not use the default header and footer template pieces, but I’ll identify two.
Another reason to avoid the default header and footer HTML is what I refer to as AJAXing your Web Template – a Chapter 2 blog. Sometimes you need to retrieve Dynamics 365 data outside of some of the standard Web Pages. With Web Templates you can do this, but you can’t have all the HTML messing with your data retrieval, specifically JSON-formatted data. Uncheck the field for that Page Template, and you’re good to go.
Now that you know the importance of Page Templates and the difference between Rewrite and Web Template types, you can begin building or utilizing existing Web Templates to create visually-appealing Portal websites.
If you have questions about using Portals in Dynamics 365, please connect with us!
Which Dynamics Product Is Best for You?
Answer some basic questions about your company and your requirements, and find out what products would fit your business.Take Our Quiz