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.

Trouble with an Alphabetical Entries List

May 23, 2010 3:10am

Subscribe [1]
  • #1 / May 23, 2010 3:10am

    Everett

    25 posts

    I’m following the Second Method posted in the wiki at http://expressionengine.com/wiki/Alphabetical_Entries_List/

    Here is the first template, directory/letters, in its entirety:

    <ul>
    {exp:query sql="SELECT title, entry_id, url_title AS urlt
    FROM exp_weblog_titles WHERE weblog_id = '5'
    AND title LIKE '{segment_3}%' ORDER BY title ASC"}
    <li><a href="{path=directory/listing}{urlt}/">{title}</li>
    {/exp:query}
    </ul>

    Here is the second template, directory/test, in its entirety. It’s meant to display all entries that start with A from weblog id 5.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title> Directory</title>
    </head>
    
    <body>
    
    <h2>A</h2>
    
    <p>{embed="directory/letters/a"}</p>
    
    <p></body></p>
    
    <p></html>

    When I view http://www.example.com/index.php/directory/test/ I see the actual text {embed="directory/letters/a"}

    Screen shot attached.

    For comparison,

    {embed="directory/letters"}

    works, it just shows all entries, instead of only those that start with A.

    Any suggestions? I’m using ExpressionEngine 1.6.7 Build: 20090515

    [Mod Edit: Moved to the How to forum]

  • #2 / May 23, 2010 6:09am

    KeithW

    138 posts

    If you want only the items starting with A then your select statement should be
    “... AND title LIKE ‘A%’ ORDER BY title ASC”
    as explained in the Wiki article.

    Haven’t tried the second method, but
    maybe {embed="directory/a"} would work?

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

ExpressionEngine News!

#eecms, #events, #releases