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.

link to first entry in category only

July 08, 2007 12:47am

Subscribe [2]
  • #1 / Jul 08, 2007 12:47am

    jducka1

    12 posts

    I am using the Weblog Categories tag to list my categories on a page.  I want each category in the list to link to the FIRST entry in that category.  What I have so far links to the template and lists all the entries in the category.  I want it to show only the first. 


    {exp:weblog:categories weblog="{my_weblog}” show_empty=“no” style=“linear”}

    {if category_image != ""}
    {category_image}
    {/if}

    {category_name}</div>

    {/exp:weblog:categories}

    Anyone know how I should do this?

    Thanks

  • #2 / Jul 08, 2007 1:09am

    PXLated

    1800 posts

    If I understand correctly, the category list from the code you listed works ok, it’s just after clicking one of those links…going to the portfolio_detail template…you only want one entry to show. Assumming I’m correct, then your code in the portfolio_detail is where something is wrong and you don’t give us that code so I’m guessing it should probably be a weblog entries tag something like this…same as for any single entry page…

    {exp:weblog:entries weblog="weblogName" category="10" limit="1"}
    You’d add sorting and any other parameters that might apply.

  • #3 / Jul 08, 2007 1:18am

    jducka1

    12 posts

    Yes, that’s it!  I had thought I should be passing the limit in the link, but obviously it can be done in the display template itself.  Thank you!

  • #4 / Jul 08, 2007 1:35am

    PXLated

    1800 posts

    Glad you got it working.

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

ExpressionEngine News!

#eecms, #events, #releases