Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7248085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:05:29+00:00 2026-05-28T22:05:29+00:00

I would like to create another page-based loop, in the same way the _posts

  • 0

I would like to create another page-based loop, in the same way the _posts folder works for the blog section, but for a small catalogue of magazines. (Hopefully that makes sense)

Maybe i’m misunderstanding something simple, but I just can’t work it out.
I have this loop, which feels like it should work, but nothing gets returned.

{% for page in site.pressitems %}
<li>
    <a href="{{ post.url }}">{{ page.title }}</a>
</li>
{% endfor %}

Code, links, explanation, anything is greatly appreciated. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:05:30+00:00Added an answer on May 28, 2026 at 10:05 pm

    You can’t add your own collection to site just like that.

    site only knows about three collections: pages, posts, and categories. You can get all the posts of a category by doing site.<category>.posts . AFAIK, categories only work for posts, not pages.

    This makes sense, since Jekyll is supposed to be mainly a blogging engine, and not a generic static website generator.

    So your best solution right now consists on “lying” to jekyll. Make it believe you have posts, when in reality you are making pages.

    _posts/
      pressitems/
      blog/
    

    You will be able to loop over the elements inside _posts/pressitems like this:

    for item in site.categories.pressitems.posts do
      ... {{ item.title }} ... {{ item.url }}
    endfor
    

    Similarly, your “real blog entries” would go this way:

    for p in site.categories.blog.posts do
      ... {{ p.title }} ... {{ p.url }}
    endfor
    

    The catch is that you will have to respect Jekyll’s naming convention regarding filenames; your pressitems have to look like real posts. This means they have to be named starting with a yyyy-mm-dd- string, like posts. Just give them a random date.

    _posts/
      pressitems/
        1901-01-01-the-first-press-item.textile
        1902-01-01-the-second-one.textile
    

    EDIT: This was true when this post was originally written, in 2012, but not any more. Modern Jekyll does allow you to create your own collections https://jekyllrb.com/docs/collections/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a java List based on another java Collection eg.
I have the column DateTimeExpired, and I would like to create another column called
I would like to create the XML string on the the aspx page and
I would like to create a variable in one php page and then use
I would like create my own collection that has all the attributes of python
I would like create a web service in ASP.Net 2.0 that will supports JSON.
Would like to create a strong password in C++. Any suggestions? I assume it
I would like to create a database backed interactive AJAX webapp which has a
I would like to create an SSL connection for generic TCP communication. I think
I would like to create a file format for my app like Quake, OO,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.