1

I'm wondering what's the best way of approaching a situation where you have an A to Z of categories in a sidebar and when you click the category URL it loads the results of that channel within the same page.

I know there's a plugin for this - Low AtoZ, but wondering if there is a simple way of doing this without using any commercial plugins. At the moment I'm using Freebie to break the main url segment so EE doesn't try to look for the page. A good way to start?

<aside>    
<ul>
        {exp:channel:categories channel="resources"}
            <li><a href="{site_url}resources/{category_url_title}">{category_name}</a></li>
        {/exp:channel:categories}
        </ul>
    </aside>
    <div class="content-main">
        <div class="breadcrumbs">
            <ul>
            {exp:structure:breadcrumb here_as_title="yes" separator="/" wrap_each="li"}
            </ul>
        </div>
        <h1>{title}</h1>
        {page_content}
        {if "{freebie_1}" == 'resources' && "{freebie_2}" == ''}
        <h3>Please choose a county from the list to the left.</h3>
        {if:else}
        <div class="resources-listings">
            {exp:channel:entries channel="resources" dynamic="no" category="1"}
            <div class="listing">
                {if resources_center_type == 'Suicide Prevention'}
                <div class="label red">
                    <span>Suicide Prevention</span>
                </div>
                {if:else}
                <div class="label green">
                    <span>Bereavement Support</span>
                </div>                                          
                {/if}
                <h3>{title}</h3>
                {if resources_role}<p class="role">{resources_role}</p>{/if}
                {if resources_address}<p><strong>Address: </strong>{resources_address}</p>
                {if resources_phone}<p><strong>Tel: </strong>{resources_phone}</p>
                {if resources_email}<p><strong>Email: <a href="mailto:{resources_email}">{resources_email}</a></strong></p>
                {if resources_info}<p><strong>Additional Information: </strong>{resources_info}</p>
            </div>
            {if no_results}
                <h3>There are currently no resources available in this county.</h3>
            {/if}
            {/exp:channel:entries}
        </div>
        {/if}
1

With wgcode_categories, you can add an orderby="cat_name" parameter.

| improve this answer | |
  • Would you mind adding a little more detail on how this should be set up in the code? - Maybe with an example. – Paul Redmond Dec 6 '13 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.