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.

How to list article title or heading from different categories?

June 29, 2007 1:22pm

Subscribe [2]
  • #1 / Jun 29, 2007 1:22pm

    eeuser

    10 posts

    I am really very new to EE.

    I am trying to list all the article titles or heading from three(3) categories and paginate the list by limiting to 10 titles per page. Also, when the user click on the title link it will take the user to the main article.

    Example

    Article title 1 <—when clicked on the article it will take the user to the actual article
    Article title 2
    Article title 3
    Article title 4

    < pagination here or top and bottom>

  • #2 / Jun 29, 2007 1:47pm

    silenz

    1651 posts

    All you need is the numbers of the categories you wish to pull the entries from.
    You find them under
    CP Home ›  Admin ›  Weblog Administration ›  Category Groups >  Add/Edit Categories

    Then you specificy them in the weblog:entries-tag like seen below:

    {exp:weblog:entries category="2|4|7" weblog="myweblog" limit="10" paginate="both"}
    
    <a href="{path=site/article}">{title}<a> 
    
    
    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}
    
    {/exp:weblog:entries}
  • #3 / Jul 02, 2007 4:43pm

    eeuser

    10 posts

    Thanks Silenz

    I modied ur sample code and added my list of categories but it didnt return any results.
    Do i need to add the paths(”{path=site/article}”) manually for each of the titles?

    I want to list the titles with the links that will be pulled dynamically from the 3 categories, so when u click on the link it take to the main article.
    Example

    Article title 1 <—when clicked on the article it will take the user to the actual article
    Article title 2
    Article title 3
    Article title 4

    < pagination here or top and bottom>

    Code Listed BElow

    {exp:weblog:entries category="4|5|15" weblog="myweblog" limit="10" paginate="both"}

    <a href=”{path=site/article}”>{title}<a>


    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}

    {/exp:weblog:entries}

  • #4 / Jul 02, 2007 6:21pm

    silenz

    1651 posts

    You dont have to enter the link per title. The code is supposed to make ten titles linked to the article pages.

    weblog="myweblog"

    has to be replaced with the actual name your weblog.

  • #5 / Jul 02, 2007 7:12pm

    eeuser

    10 posts

    Thanks it worked 😊

    I just took the weblog part out. I tried testing putting the weblog name and without both works.

    But, I ran into a little bit of a problem with the links. it seem to link to a default link when you click on the title links. they dotn seem to link up correct to the articles all goes to a default link.


    Thanks in advance

    Code below
    ====================================================================
    {exp:weblog:entries category="4|5|15" limit="100" paginate="both"}

    <a href=”{title_permalink=">{title}<a> {author}


    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}

    {/exp:weblog:entries}

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

ExpressionEngine News!

#eecms, #events, #releases