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.

Linking to a uploaded file in a category archive loop

October 05, 2010 4:23am

Subscribe [2]
  • #1 / Oct 05, 2010 4:23am

    Greazer

    2 posts

    Hi Everyone,

    I’m wondering if anyone could help clarify something for me.

    I have a category archive loop here, that is spitting out the title of each document I have assigned to a category from my ‘document’ channel.

    Just wondering how I can link the title to the actual document.
    I’ve tried using…

    {entry_titles}
    <a href="http://{document_file}">{title}</a>
    {/entry_titles}

    , but that doesnt work.

    {document_file} being the custom field that connects a file to its upload directory.

    loop:

    {exp:channel:category_archive 
         channel="document" 
         style="linear"
    }
    
    <!-- spit out the category title & description -->
    {categories}
    <h3>{category_name}</h3>
    <p>{if category_description}{category_description}{/if}<br />
    {/categories}</p>
    
    <p><!-- spit out any documents associated to this category --><br />
    {entry_titles}<br />
    <a href="http://{path=SITE_INDEX}">{title}</a><br />
    {/entry_titles}</p>
    
    <p>{/exp:channel:category_archive}

    Thanks in advance

  • #2 / Oct 05, 2010 10:20am

    Sue Crocker

    26054 posts

    Greazer, the category archive is meant to display a list of titles only, not gather information from inside those entries.

    You could PHP or something similar to go into the database and retrieve the content, but do you need to see all the categories on one page, or would showing just one work for you?

  • #3 / Oct 05, 2010 8:26pm

    Greazer

    2 posts

    Hi Sue,
    Thanks for your reply.

    I’ve actually been put onto this post by Lodewijk Schutte regarding “Nesting tags and performance in EE” : http://loweblog.com/freelance/article/nesting-tags-and-performance-in-ee/ which seems to be the answer I was looking for.

    Thanks

  • #4 / Oct 06, 2010 9:43am

    Sue Crocker

    26054 posts

    Glad you found a solution. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases