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.

List of downloads that are categorised..

September 19, 2011 10:23am

Subscribe [2]
  • #1 / Sep 19, 2011 10:23am

    Etheya

    213 posts

    This sounds really simple yet for some reason I’ve never come across doing something like this before.. and yet have run into a problem.

    Client has a list of downloadable files that are either PDF or EXCEL files.. these are then categorised so that they are easy enough to find. I want to show a page which contains these downloads, listed within their categories.. so i thought Category_archive would work great… which it does up to the point that the custom field that contains the location of the download file doesn’t seem to work within the

    {entry_titles} tags… is this possible or have i done this a completely stupid way.. thought it would work great at first… hmmm

    {exp:channel:category_archive channel="downloads" style="linear" show_empty="no" }                
        {categories}
        <h4>{category_name}</h4>
    <p>        {if category_description}{category_description}{/if}<br />
        {/categories}<br />
        {entry_titles}<br />
            <li><a href="http://{downloads-file}">{title}</a></li><br />
        {/entry_titles}<br />
    {/exp:channel:category_archive}

  • #2 / Sep 19, 2011 3:48pm

    John St-Amand

    865 posts

    Yes, unfortunately you can’t access your custom fields within the entry titles loop.  It’s just for titles.  Here’s what you would want to use (or something like it):

    {exp:channel:category_archive channel="downloads" show_empty="no"}
        {categories}
                <h4>{category_name}</h4>
    <p>             {if category_description}{category_description}{/if}<br />
                                            <br />
            {exp:channel:entries channel="channel_name" category="{category_id}"}<br />
                {if count == "1"}<ul>{/if}<br />
                <li><a href="http://{download-file}">{title}</a></li><br />
                {if count == total_results}</ul>{/if}<br />
            {/exp:channel:entries}</p>
    
    <p>    {/categories}<br />
    {/exp:channel:category_archive}

    Hope that helps you out.

  • #3 / Sep 19, 2011 4:18pm

    Etheya

    213 posts

    Hi there…yes that makes sense and is pretty much what i ended up with in the end to be honest.. but thanks, good to know ive gone the right way.

    Many thanks
    B.

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

ExpressionEngine News!

#eecms, #events, #releases