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.

Display PDF Documents by Category

August 20, 2009 5:44am

Subscribe [1]
  • #1 / Aug 20, 2009 5:44am

    cultivate

    37 posts

    Id like to setup a page which would display like this http://dev.cultivatecreative.co.uk/bacsol/old/case_studies.php

    I have a weblog setup with a custom field to enter the link to the pdf and a set of categories. I have then setup a template with the following code (taken from the wiki):

    {exp:weblog:category_archive weblog="{my_weblog}" show_empty="no" id="my_custom_id"}
    
    {categories}
    <h3>{category_name}</h3><p> <br />
    {if category_description} {category_description} {/if} </p>
    
    <p>{exp:weblog:entries weblog="{my_weblog}" orderby="date" category="{category_id}" sort="asc" limit="50"}<br />
    <a href="http://{document}">{title}</a><br />
    {/exp:weblog:entries} </p>
    
    <p>{/categories}<br />
    {/exp:weblog:category_archive}

    This is generating the list of categories and displaying the links to pdfs associated with the category, but all in the same

    <ul>

    tag, which is not quite what i am after.

    Is there another way i could do this?
    Im thinking that creating each category as an entry instead, and adding the related links to the entry.

  • #2 / Aug 24, 2009 10:55am

    cultivate

    37 posts

    Anyone have any ideas?

    Thanks

  • #3 / Aug 26, 2009 11:05am

    cultivate

    37 posts

    I have found a simple solution. (isnt it always!)

    <ul>
    {exp:weblog:entries weblog="{my_weblog}" category="35" sort="asc" limit="10" disable="member_data|trackbacks|pagination"}
    <li><a href="http://{document}">{title}</a></li>
    {/exp:weblog:entries}
    </ul>

    I have done that for each category, which works as id like it to.

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

ExpressionEngine News!

#eecms, #events, #releases