Creating a new page and its companion View

To create an new view you must follow these steps:

  1. Create a page in Wordpres ( Pages > New Page ) –e.g. “My Profile”
    NOTE: In this example WordPress will generate the slug “my-profile”.
  2. Create a View using the name convention “page-[page-slug]”. For this example you must create a view named “page-my-profile”.
  3. Once you complete steps 1 and 2, the framework will automatically override the WordPress Page output with the content of the view.
    NOTE: If you try to preview the page that you created (e.g. http://appcropolis.com/my-profile), you will se a blank page, because you have not added any content to the view.
  4. To integrate the WordPress page content with your view you must use the template syntax. Once you have done that you should be able to see the WordPress pages rendered using the code that you defined in your view. See code below.

 

1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>My Profile Page</title>
    </head>
    <body>
       <h1>{$post.post_title}</h1> 
       <p>{$post.post_conent}</p> 
    </body>
</html>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>My Profile Page</title>
    </head>
    <body>
       <h1>{$post.post_title}</h1> 
       <p>{$post.post_conent}</p> 
    </body>
</html>