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 7036319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:24:36+00:00 2026-05-28T01:24:36+00:00

I want to have catalog result displayed using the following codes from my Archetypes

  • 0

I want to have catalog result displayed using the following codes from my Archetypes package. The issue is the displayed listing not according to the positional order in Contents tab. What am I missing?

class BookView(BrowserView):

    implements(IBookView)

    def get_chapters(self):
        context = aq_inner(self.context)
        catalog = getToolByName(context, 'portal_catalog')
        folder_path = '/'.join(context.getPhysicalPath())
        results = catalog(
                      path={'query': folder_path, 'depth': 1},
                      portal_type=('File', 'Chapter')
                  )
        return results


<div class="books-pdf"
     tal:define="chapters view/get_chapters"
     tal:condition="chapters">
  <span class="listname"
        i18n:translate="">Chapter Name</span>
  <span class="iconname"
        i18n:translate="">File Type</span>
  <span class="sizename"
        i18n:translate="">File Size</span>
  <tal:chapters repeat="chapter chapters">
  ...
  • 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-28T01:24:37+00:00Added an answer on May 28, 2026 at 1:24 am

    The catalog returns items in internal order unless you explicitly request an order. You can do so with the sort_on parameter, which should be the name of an index to use for the sorting.

    Most indexes can be used for sorting, with the notable exception being full text indexes (which is why there is a sortable_title index in the Plone catalog).

    You probably want to sort on the getObjPositionInParent index, which holds the index of each object in it’s container:

        results = catalog(
            path=dict(query=folder_path, depth=1),
            portal_type=('File', 'Chapter'),
            sort_on='getObjPositionInParent',
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mp3 catalog portal and I want to customize my urls. I used
I have an catalog with a lot of files. I want to count every
I'm using SQLServer 2008 and if I perform the following query: SELECT * FROM
I have many xml file's, I do not want to get the value, but
I have the following query: SELECT a.topicID, d.catalogFileID, d.catalogFileExtension, a.sortorder FROM catalog_topics a LEFT
In /app/design/frontend/default/[theme]/template/catalog/product/list.phtml you have the following snippet that loops through and displays the $_productCollection
I want to implement Full Page Cache, but currently I have 1 issue to
I currently have a catalog of files I want to read into my program
i want to remove some fields like description,short description from catalog->Manage Products->continue->general tab in
i want have an image and i want to set it as a background

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.