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.

news template

May 29, 2008 6:58am

Subscribe [2]
  • #1 / May 29, 2008 6:58am

    Steven Grant

    894 posts

    I want to include on all of my templates a news feed that displays the 3 most recent news items.

    I then want the user to click on *read more* to link through to the full story.

    What I have on this include is:

    <h1>latest news</h1>
    {exp:weblog:entries weblog="news" limit="3"}
            <h2>{entry_date format="%d %M, %Y"}</h2>
    <p>        {title}<br />
             {if allow_comments} <br />
    <a href="http://{url_title_path=">read more…</a><br />
    {/if}</p>
    
    <p>        <br />
    {/exp:weblog:entries}

    I then have:

    {embed="tutorial/news_snippet"}

    on my template.

    unfortunately, this doesn’t work.

    any ideas what’s wrong?

    Cheers,
    S

  • #2 / May 29, 2008 7:12am

    Mark Bowen

    12637 posts

    Hi there Steven,

    Have you tried adding the dynamic=“off” parameter to your weblog tag?

    Hopefully that should do it for you. If not then if you can let us know in what way it isn’t working then that would be of a little more help 😉

    Best wishes,

    Mark

  • #3 / May 29, 2008 7:16am

    Steven Grant

    894 posts

    no that’s not working either.

    This is the page I’m working on:

    http://www.christatwork.org.uk/dev/index.php?/tutorial/index/

    as you can see the news item (only 1 of them at the moment) displays OK - the issue is linking through to the article in it’s entirety. The *read more* hyperlink doesn’t appear to be linking properly.

  • #4 / May 29, 2008 7:26am

    Mark Bowen

    12637 posts

    Oops sorry didn’t see the mistake in the code above.

    Try this :

    <a href="http://{url_title_path=tutorial/comments}" title="{title}">read more…</a>

    You had an extra bracket in there and an extra speech mark. I also converted your dots to an ellipsis just because I’m a picky monster 😉

    Hope that works?

    Best wishes,

    Mark

  • #5 / May 29, 2008 7:37am

    Steven Grant

    894 posts

    sweet as mate - that worked like a charm

  • #6 / May 29, 2008 7:43am

    Mark Bowen

    12637 posts

    No problem 😉

    Sorry I missed it first time. Wasn’t too sure what was not working though so that’s my excuse 😉 Plus the fact I only got about 2 hours sleep last night 😊

    Any more problems just give us all a shout.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases