ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Best practice

October 30, 2012 5:19pm

Subscribe [3]
  • #1 / Oct 30, 2012 5:19pm

    simplyonline

    3 posts

    Hi,

    I’d like to find out about the common practice of publishing a new site.

    What I think:
    1. Create a HTML file (basically this contains a reusable design / layout for all pages - things that won’t change)
    2. Create a CSS file to style the HTML file
    3. I’ll publish a new entry under content, filling in the other HTML code that I like on the site.

    Is this what others do / you do?

    Thanks so much.

  • #2 / Oct 31, 2012 5:31am

    Nope.

    Create a new html for each main page on your website.
    User embeds to re-use common elements like headers & footers.

    Try to use ExpressionEngine for your content, not your html tags.

  • #3 / Oct 31, 2012 5:58am

    simplyonline

    3 posts

    Hi Jan,

    Thanks for your reply.

    Wouldn’t using html for each page defeat using a CMS? So If I’d have 100 ‘main’ pages, I’d have to create 100 html templates? If I then need to change one link in the footer, I’d have to update all these templates. Maybe I’m missing something.

    “Try to use ExpressionEngine for your content, not your html tags.”
    How can I style / arrange content when publishing trough the the usual channels? The only way I see is by using some mark-up.

  • #4 / Oct 31, 2012 6:28am

    With a main page I mean: home, about, blog, contact. These kind of pages.
    Unless you’re building a huge site, you want reach 100 different html pages.

    For common elements like your footer you use embeds. which means you only have to edit it once to make the change appear throughout the site.
    http://expressionengine.com/legacy_docs/templates/embedding_templates.html

    You define your style in your html page, not in your channel content.
    A typical html-page ( called a template ) looks like this:

    <!DOCTYPE html>
    <html>
    <head>
            <title>Title</title>
            <meta charset="utf-8">
    </head>
    <body>
            <h1>All the news.</h1>
    
            {exp:channel:entries channel="news" limit="10"}
                    <h2>{title}</h2>
    <p>                By {author}</p>
    
    <p>                {news_body}<br />
            {/exp:channel:entries}<br />
    </body><br />
    </html>

    Note how all the HTML is specified in the template page, the channel just outputs the data.

    These are all very basic principles of ExpressionEngine by the way, so you might want to read the Starting Guide first:
    http://ellislab.com/expressionengine/user-guide/getting_started/index.html

  • #5 / Oct 31, 2012 4:53pm

    Shane Eckert

    7174 posts

    Hey simplyonline,

    I think Jan has covered this pretty well.

    The idea is to create just a few templates with some channel entries tags so that you can submit entries to a channel and create that content that way. You would only have a few template with your HTML/CSS in them.

    Does that make sense?

    Cheers,

  • #6 / Nov 02, 2012 2:03am

    simplyonline

    3 posts

    Hi Everyone,

    It works wonders. I’m now using templates for everything static but replaced footer / header etc with the appropriate tags to link to other templates.

    However now I’m running into problems with URL’s.

    Edit - Delete - Clean up

    I’m really lost.

    Edit 3:

    Okay so let me summarize:
    1. I use templates for static pages
    Group (design) / Name of template (crevision)
    mydomain.com/index.php/design/
    mydomain.com/index.php/design/crevision

    a) How can I create sub-sub-pages?


    2. I use channels for dynamic content / not main pages
    a) So I should create a channel called ‘design’
    b) How does the URL scheme work here? Will content in a channel automatically follow the structure?
    When I try to save a new channel post ‘name’ under design, it will tell me the url is invalid. I can only save when I assign a new URL ‘name’ and then I can find it under mydomain.com/name ... Is this supposed to be?

    3. So if I’m a single user, the page module / template module is similar?
    a) I can only create main pages and assign templates e.g. mydomain.com/page
    How can I create a sub-page? It won’t accept mydomain.com/page/page2

  • #7 / Nov 06, 2012 12:23pm

    Shane Eckert

    7174 posts

    Hello simplyonline,

    Awesome! Glad you are on your way!

    What do you mean by subpages? You mean more templates that are hard coded and not using channel entries tags for dynamic content? Just create those templates in the same template group. But you are better off using one template with dynamic content and publishing to that channel. The title field in the entry becomes the “page” name.

    A page is the same. Use one template for the pages to be run through and then in the publish section set the URL for the page and select which template to use for that entry. That will be the template you setup as the pages template.

    Does that make sense?

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases