Thundered

Ramblings of a Teenage Boy.

Expression Engine: Pages

ExpressionEngine Core doesn't come with a pages module, so you can't create "pages" in the traditional sense without paying for the personal license. However, there is a workaround of some sorts. The structure of these faux pages is to create a weblog for each section of your website and then each page will be an entry under these weblogs. It may sound confusing, but it'll make more sense once you finish reading this tutorial.

Tutorial

  1. Click on the Publish tab and under the drop down menu, select Edit Weblogs.
  2. Click on the green button in the top right hand corner that says Create a New Weblog. Under the different input forms, here is what I put, if I were creating a weblog to house the pages about me
    • Full Weblog Name: About
    • Short Name: about
    • Duplicate existing weblog's preferences: Do not duplicate
    • Under the box that says Create New Templates For This Weblog?, select Duplicate Existing Template Group and select the main default blog template that you're using. Then, underneath that, write About (if you're creating a section about yourself/your website).
  3. Now that our weblog is created, click on the Template tab and find the newly created template group that corresponds with your weblog (mine is called About).
  4. Click on the index template and put this code at the top. {assign_variable:my_weblog="about"} {assign_variable:my_template_group="about"}.
  5. Unless you want comments on your weblog, delete the stuff pertaining to comments and pagination.
  6. Also, in the area that says exp:weblog:entries, find the part of it that says Limit and set it as limit="1". For reference, this is how my index page looks:
    {embed="includes/header"}
    {assign_variable:my_weblog="about"}
    {assign_variable:my_template_group="about"}
    <div id="main">
    {exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="1" disable="member_data|trackbacks"}
    <h2>{title}</h2>
    {summary}
    {body}

    {/exp:weblog:entries}
    </div>
    {embed="includes/footer"}
  7. Now that we have our templates ready to go, hover once again over the Publish tab and select your weblog. Then, write the post that will serve as your main "about" page. But before you click the Publish button, we have to edit our settings a little! At the top, click on Options and make sure that you have checked Make Entry Sticky.
  8. To create other pages under this section, just go to your Publish tab, find your weblog under the drop down menu, and write a new entry. You can link to your new page as yourdomain.com/sectionname/page/.

Now your section/weblog should be up and running. You can view it at yourdomain.com/index.php/sectionname or yourdomain.com/sectionname if you've used your .htaccess to get rid of the index.php. If you have any questions about this tutorial, feel free to email me at alex.thundered[at]gmail.com.

Posted in Online,coding,expression engine, on July 15, 2008 at 08:49 PM
Permalink