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.

Tying a new weblog entry to a new template

June 30, 2007 7:01pm

Subscribe [2]
  • #1 / Jun 30, 2007 7:01pm

    benjad

    5 posts

    Hi, so this may be really easy or impossible, I’m really new to this. I want to have a new   URL created each time a new entry is posted on a blog. So a new page for each entry that could contain comments and such, and be directly linkable. Is there anyway for a new template to automatically be created (based off some premade one) with the content that is published?
    For example Wonkette.com has a separate page for each of it’s entries as well as listing them on the main site. I doubt they manually create a new page each time they post.

  • #2 / Jul 01, 2007 4:17am

    benjad

    5 posts

    I guess what I’m saying, if people don’t understand, is how can I make a new single entry page be created when a new entry is posted in a weblog

  • #3 / Jul 01, 2007 5:06am

    allgood2

    427 posts

    It’s not that a new template is being created each time an article is published; it’s that the same template is being called to display each post individually.  For example, you mot likely have an index page, that is displaying, summaries or full text of each article that you post. If it’s fulltext, what a lot of individuals do is forget that they can still separate articles to their own page for comment or other purposes.  Personally, I use an “article” page, but the “comments” page is very popular.

    The comments/article page is just a template that tells Expression Engine to display one entry at a time. So the code would look something like:

    {exp:weblog:entries weblog="news" limit="1"}
    
    <h3>{title}</h3>
    
    <p>{body}</p>
    
    <p><div class="date">Posted on {entry_date format="%M %d, %Y - %h:%i %A"}</div></p>
    
    <p>{/exp:weblog:entries}

    Basically then from the index page you might create a title link or a view more link that then points to the {permalink} or {path} for the article, typically in a

    {path={template_group}/{template}}
    so for example
    {path=weblog/comments}
    alternatively you could also use
    <a href="http://{comment_url_title_auto_path}">my entry</a>

    Personally, I’m a fan of comment_urls because I try to restrict the number of ways search engines can access a single article. I prefer just three options, index, archive, and article page; where two of those options ONLY provide summary data, so that the full article is ONLY ever available through an article page.

    Anyway, you probably want to read the Weblog Entries from the manual.

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

ExpressionEngine News!

#eecms, #events, #releases