True Stories Project

Can't create pages -- totally confused

Vote 0 Votes

Hi -- I've gotten pretty used to creating entries using entry templates and such but I have no idea how to create a PAGE.

I've tries to create a test page in a test folder on my site but it doesn't appear anywhere. It shows up in my pages entry list but when I click on "view page" it just brings me to site root.

I am assuming it's not finding a template maybe? But this is what is most confusing, what templates am I using for pages? I have my templates and CSS set up for entries and entry categories but there's no info that I can find that explains where pages fit into all this.

Thanks much!

Reported on Movable Type 4.3

13 Replies

| Add a Reply
  • If MT wasn't finding required templates then it would through an error and wouldn't save. You would know it.

    Is the status "published" or "draft"? That is in the upper right of the page edit panel.

  • Thanks for the response. The status is published. When I click on "view" (which only shows up when it's published), it goes nowhere. It's not on my server at all.

    So that's a mystery. But I still don't understand which templates it's supposed to be using. Are these "entries" or what? The nomenclature on "pages" vs. "entries" is not well explained on MT.

  • You should have a "Page" template in the "Archive Templates" section of your templates. The Archive path should be something like "folder-path/page-basename.html"

    Do you have that template, and what is your Archive Path?

  • Thanks Rick. I didn't have any templates in the Archive Templates section except for the one Entry Archive template I use for all of my entry categories.

    SO I cloned that and changed the the path to templates/page-basename.html (templates folder is where I keep my templates). Is this wrong? I tried the path pages/page-basename.html too as pages is one of my folders set up under folders in MT.

    Neither worked.

    Then I set up a new folder called testfolder but it didn't show up on my server, even though it's listed in MT and I published the site. Weird.

    Then I figured it must be because when I cloned the entry archive, I needed to change the entry tags to page tags. So I changed those as best I could, figuring that at least somethng would show up -- but no dice. It's not giving me an error. It's just spitting me to the base URL and not creating an actual PHP file on my server.

    What am I missing?

    And, as importantly, why isn't there some kind of page tutorial on MT site? If it's different than entries, shouldn't that be explained?

    So appreciate your help.

  • Well, page and entries are very similar, you can use many of the tags just the same. But not exactly. It is usually best when startin out to pick a theme with al the templates that you are going to use. I never saw a theme without a page template.

    Look into your installation, there should be a directory in the application folder (mt4 or whatever) called "default_templates". You will find a template callled page.mtml. Open that in a text editor. Create a new template from your web panel called "Page" and copy paste the code from page.mtml into the new Page template. Set the archive path, save and publish. This is what a default page template looks like:

    Actually before you save and publish, go through the code and make sure the included modules exist ibn your current set of templates. If not, change the names to match your corresponding module names, delete them or just use the default template to learn how irt works and write your own. You have to know HTML of course before you attempt to write your own template. But it really is HTML with a few template tags sprinkled in.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
    <head>
        <$mt:Include module="<__trans phrase="HTML Head">"$>
        <$mt:EntryTrackbackData$>
        <title><$mt:PageTitle encode_html="1"$> - <$mt:BlogName encode_html="1"$></title>
    </head>
    <body id="<$mt:BlogTemplateSetID$>" class="mt-page-archive <$mt:Var name="page_layout"$>">
        <div id="container">
            <div id="container-inner">
    
    


    <$mt:Include module="<__trans phrase="Banner Header">"$>


    <div id="content">
    <div id="content-inner">


    <div id="alpha">
    <div id="alpha-inner">


    <div id="page-<$mt:PageID$>" class="page-asset asset">
    <div class="asset-header">
    <h1 id="page-title" class="asset-name"><$mt:PageTitle$></h1>
    </div>
    <div class="asset-content">
    <mt:If tag="PageBody">
    <div class="asset-body">
    <$mt:PageBody$>
    </div>
    </mt:If>
    <mt:If tag="PageMore">
    <div id="more" class="asset-more">
    <$mt:PageMore$>
    </div>
    </mt:If>
    </div>
    <div class="asset-footer"></div>
    </div>


    <$mt:Include module="<__trans phrase="Trackbacks">"$>
    <$mt:Include module="<__trans phrase="Comments">"$>


    </div>
    </div>


    <$mt:Include module="<__trans phrase="Sidebar">"$>


    </div>
    </div>


    <$mt:Include module="<__trans phrase="Banner Footer">"$>


    </div>
    </div>
    </body>
    </html>

  • Oh, one thing. Remove the __trans phrase code from the tags. Those tell the installer to replace the prhrase in the quotes with the language of your choice. If your language is English, then you can usually use the "default" phrase given. So

    <$mt:Include module="<__trans phrase="Banner Footer">"$>
    

    becomes

    <$mt:Include module="Banner Footer"$>
    

    If you are missing a lot of templates it may be easier to install a new theme.

  • You may like to know that the difference in between pages and entries is that pages could be archived by folders, while entries could be archived by category.

    Pages are commonly used for general pages such as about, contact, etc. or for pages that go inside folders as could be the case with information about various departments of a company, basically pages that would have the exact same content during the life of the project or site.

    Entries are commonly used for publishing a blog. They contain a reference to the creation date and could be sorted by category.

    In order for a page that you create to be published by movable type as an individual item you have to make sure that your blog has an "Archive Template" whose type to be "Page".

    Judging by the symptome you've mentioned it is clear that your blog doesn't have a "Page" archive template and therefore that is the reason why the URL corresponding to a page goes to your main page.

    You should have no problem creating a "Page" archive template starting from the coding that you're having inside your "Entry" archive template.

    Just make sure that the archive type you're creating is set as "Page" and preferably also change mt:Entry or MTEntry to mt:Page.

    There are a few tags from the default "Entry" template that don't have a correspondent for pages, but if your entry template contains any of those tags, after you replace mt:Entry or MTEntry with mt:Page movable type would tell you which tags don't exist and you could remove those from your newly created "Page" template.

    Alternatively, you could use the template that Rick mentioned above, though you may like to follow my advice, because your "Entry" template might contain a custom structure which you may like to use also for "Pages", rather than starting from a default "Page" template and then making changes to it to suit your eventual custom template.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/

  • Thank you Rick and Mihai! Lots of very useful information. I'm getting there!

    I think the primary problem is that I didn't see the tiny choices at the top and started from a clone of an Entry archive. (I've always made my templates by cloning ones made by my original designer and then learned by doing). SO I never got to have the choice of archive type when setting the archive path. Once you've created your archive template, you're stuck with the type you created.

    Now it makes sense. I'll plug around the various page tags and see what's useful and what's not. I'm guessing that when it comes to updating my CSS, I'm really going to treat folders like categories and have the correspond to classes.

    Thanks again! So glad to get past that initial block.

  • You're welcome!

    What you may like to also know is that there is no way to generate an archive page for a folder, as you could for a category, so the trick to get a page at the URL corresponding to the folder is to create a page whose basename to be "index", so that when movable type creates it you could link to it as the folder page.

    With this occasion you could experiment also with sticky tags, which are tags preceeded by the @ character, such as for instance "@nosidebar" that you could use for all kind of tricky jobs (i.e. excluding the sidebar from an entry or page, whereby you check with mt:If to see if that entry or page is tagged or not with the @nosidebar tag and if it is, then you don't display the sidebar).

    Enjoy,
    Mihai

  • Yes you are welcome.

    What Mihai refers to as sticky tags are officially called private tags because they don't show up by default unless specifically requested. The most common use may be the @sticky tag (you can call it @top or whatever), which always show the most recent entry tagged "@sticky".


    -- Your code here --

    followed by:


    -- Your code here --

    Regarding categories and folders, I found a nice trick to help them peacefully coexist. Say for example you have your main navigation based on categories. If you try to put a page called "index.html" into a folder with the same name and location as a category, it may very well be overwritten by the "category entry listing" template, which is usually set up to generate index pages with entry summaries for that category.

    One solution is to name the page "home.html" and then add this to a ".htaccess" folder in that directory:


    DirectoryIndex home.html index.html index.php index.cgi

    That way links to "http://yourwebsite/category/" go to "http://yourwebsite/category/home.html" if it exists.

  • Let's try that code again

    <mt:Entries tag="@sticky" lastn="1">
    -- Code her --
    </mt:Entries>
    
    

    <mt:Entries unique="1" lastn="1o">
    -- Code her --
    </mt:Entries>

  • Hi Rick,

    You wanted to say:
    <mt:Entries unique="1" lastn="10">

    and not:
    <mt:Entries unique="1" lastn="1o">

    i.e.
    Note that your "1o" is "1" and the letter "o" in small case :)

    And as an explanation for the person that launched this thread I would like to say that the coding you've provided as a sample does this:

    1) the first one is displaying the last entry which is tagged as "@sticky";

    2) the second part is displaying the last 10 entries, but without including the entries already displayed (i.e. the "@sticky" entry from step 1 above.

    Kind Regards,
    Mihai Bocsaru

    Cheers,
    Mihai

  • Note that your "1o" is "1" and the letter "o" in small case :)

    Yes, I saw that immediately, I just wish the forums had a comment edit function.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

137 479

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

238 797

Last Topic: Manifest Schema Compatibility Issue When Restoring Blog by Matt on Oct 17, 2012

1858 6594

Last Topic: Categories and Basename Publishing Issues by e21media on Oct 25, 2012

88 307

Last Topic: absolute publish date in Manage Entries screen by .mau. on Apr 18, 2012

1488 5347

Last Topic: Anti-cloning by .mau. on Oct 29, 2012

732 3093

Last Topic: Blog moved server - now users cannot access blog? by mowgs on Oct 30, 2012

89 317

Last Topic: How to "pretify" a url in htaccess with a few wildcards by Caio on May 30, 2012

183 771

Last Topic: Commenting with TypePad by Rob Ferrara on Oct 17, 2012

212 680

Last Topic: Does MT-Approval work in MT5? by DLpres on Sep 25, 2012

27 100

Last Topic: Upgrading MT by Caio on Oct 15, 2012

49 224

Last Topic: Movable Type 6 Ideas by Caio on May 28, 2012

65 248

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012