Introduction
Layout override is a functionality that gives the client the ability within their Page Properties > Layout administration menu to select a specific layout file and have that layout file and styling applied to that page.
This is usually used for any sub brands within a website such as a youth section or specific ministry that desires a different look other than the main site, or for a site that has a message area the client can have shown for their needs such as an event cancelation due to inclement weather message.
The basic functionality is that the client goes to Page Properties > Layout and if layout override is activated, an additional option is added to the bottom of the Administration Console where they can select to use the default layout, or any additional layouts we have allowed them to choose.
Initial Setup
Go to the site's directory in the Perpetua Console (a9.artistrymarketing.com/perpetua-console/). Check the box next to "Allow Layout Override for Child Pages." Then click save site at the bottom of the page. If the site is using qry_page_content_inheritance.cfm for it's page content query at the top of the layout file, it would be a good idea to also check the box next to "New Layout Inheritance" to resolve some issues with page content.
This will do what it says and allow the child pages of the site to be chosen by the client in the Layout Administration Console.
After setting this up, you can create your layout files and css files as you would any other site. If it is a sub brand, build the site on a hidden page or pages and you should reference and keep all images in a separate folder within the images/layouts folder to keep them from getting mixed up with the original site's images. All flash elements that you are calling and referencing have to be in the root images/layouts folder though, not your sub brand's folder.
Final Setup
After all your layout files have been built, and your site looks the way you want it, we need to do a couple things.
First we need to copy and rename our newly created layout files that we want the client to be able to select from the Administration Console. This should usually only be the sub page of a sub brand, not the home page or the email since they probably do not need to be creating more of those pages. Name it something distinctive such as _layout_youth.cfm, or _layout_homepage_message.cfm. Also make duplicates of and rename any other layout files that the client can revert to incase they need to go back to the default layout or layout without a message. Name those in the same manner.
Now we need to create a new .txt file. Open up a new document in the program Text Edit and save it as layout.txt within your project HTML folder. Within the layout.txt file, simply add your layout file names and their display names separated by a coma and no space. For example:
_layout_adult.cfm,Adult Sub Page
_layout_youth.cfm,Youth Sub Page
This will add the ability for the client to choose either of those layouts and have it applied to the page. The title that is displayed in their menu is the name that comes after the coma.
When we add this functionality however, any new pages created will adopt the layout of whatever page the client was on when they added the new page. So, if they were on the youth subpage and added a new page, the new page would default to the youth sub page layout instead of the default _layout.cfm file like it would if we did not have layout override activated. The client can always go into the Layout Administration Console and change the layout to whatever they choose. This can cause a problem with giving the client the ability to choose the home page layout. Since most home pages use page content, it may throw an error if they create a new page while on the home page layout since it will be using the home page layout for the new page and calling page content from an xml file that does not exist for that new page ID (see Page Content section of this site for more on Page Content).
Page Content Issues
Since we are creating new pages that are most likely sub pages of a main site but need to behave like they are their own site, this can cause an issue when we need to call page content.
Since these are usually not the main sub pages, we cannot use _default.xml as our configuration xml file because it is being used as the main sub page's xml file. Do your best, if you can, to inherit page content from the sub brand's main page or use xmloverride to create specific page content xml files for the specific elements on the sub pages (see XMLOverride section on this site). The problem with doing that though is we cannot use pageoverride effectively either.
If we inherit page content from the main page of the sub brand layout, the sub page of that sub brand MUST be children of the main page of that sub brand or else page content will not carry over. If they are children of other pages, children of themselves (hidden pages), or great grandchildren or deeper of the sub brand's main page (explained below), the page will break.
Also, if we inherit page content from the main page of the sub brand, we currently can only inherit three levels deep (i.e. Main page (level 1), sub pages/main nav (level 2), and sub pages of the main nav (level 3). After that, page content will not inherit to any page that is any deeper (children of the last level) and will break the page.
subpages
- Auto Display Page Title
- Blog
- CSS Animations
- Drop Down Menu
- Email Subscription
- Google Fonts
- Google Maps API
- Header Videos
- Instagram Feed
- Layout Override
- On-Page Nav Scrolling
- Onecast / Latest Sermon
- Page Content
- Page Content Edit Buttons
- Parallax Scrolling
- Per Page SEO
- Permalink Conversion
- Popup Box
- Rotator / Event Box
- Sidebar Pop-out
- Site Search
- Slider
- Social Media Icons
- Split Navigation
- Staff Module
- Subpage Module
- TinyMCE Content Editor
- Twitter Feed
- Deprecated Add Ons