Forum

Thread tagged as: Question

Get Region Names - especially collections

I'm cycling through a navigation group to generate a PDF library. I use collections to house my product libraries, and each page has a different collection. (using Collections->Manage from this Page) .

I know my "pagePath" from the perch_pages_navigation, but I'm unsure how to get the collection names associated with each page. It seems that perch_content_custom requires that I know the region name, but since each collection name is unique... I'm stuck...

Raymond Wiggins

Raymond Wiggins 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

We don't currently have a programatic way to get a list of available collections. What sort of thing would you need?

Luckily I named my collections with the same name as a slug contained in the page, so I think I'll be able to work through it.

Though it would be nice to be able to get from the page a region that contains the collection name.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll give it some thought.

I'd like to see something like this if possible:

        $collections = perch_collection_list();
        foreach ($collections as $collection) {
            perch_collection($collection->name, array(
                'template' => 'list.html'
                     ));    
        }