Note: Since the release of Oxygen 1.4 on March 17th, Views are now called Templates.
Views are a flexible way to apply the same design to multiple pieces of content.
For example, you may have a website with 100 blog posts and 200 WooCommerce products. You'll create a View that will apply to all of your blog posts, and another View that will apply to all of your products. You might want to display products that are on-sale a little bit differently, so you could create another View that only applies to products that are on sale.
You can create views from the Oxygen -> Views page in the WordPress admin panel.
Any time a user visits any page on your site, Oxygen does the following:
1. Check to see if a Custom View applies to that content. If so, render the page using that view.
2. Check to see if any Views have rules that match the requested content. If so, that View is used. If multiple Views could apply, the View with the highest priority order is used.
1. Single Views
There are many different types of content that can be stored in WordPress - blog posts, Pages, WooCommerce Products, and thousands of other post types. A Single view displays a single post - i.e. one WooCommerce Product, one page, one blog post, etc. Code blocks in single views behave the same way they would in the single.php
2. Archive Views
Archive views display multiple singles. An "Author" archive could display all blog posts by a particular author. A Shop archive could display all WooCommerce products. A "taxonomy" archive could display all content in the specified taxonomies, i.e. all real estate listings that are in the "Rental" taxonomy.
3. Re-Usable Parts
Re-usable parts are things like your site's header and footer that you want to re-use on many pages of your site. You can create a Re-Usable Part out of part of a design you've already created in the DOM Tree by clicking the menu icon for the element and clicking "Make Re-Usable".
4. Special: get_header/get_footer
Some plugins that output extremely customized content, i.e. forums, etc. mostly bypass WordPress themes. They call get_header to get the header of your site, then they do their own thing and output their own content, and then they call get_footer to display the footer of your site. Normally, your site's header and footer are in your theme template files - header.php and footer.php. In Oxygen, you just specify a header and a footer that will be returned by get_header and get_footer here.
You can execute PHP code using a Code Block component. When using a Code Block in a View, it will behave (mostly) the same way they would if you put them in a template file like single.php, archive.php, etc.
For example, if you create an Archive view that applies to a certain taxonomy, a code block containing the WordPress loop would loop through all the posts inside that taxonomy.
When a view applies to multiple pages or archives, you can preview each one from the Preview dropdown in the toolbar. The code in the Code Block will now behave as if an end-user was loading that page on the frontend.