Keystone, feature galleries on home page

85 views Asked by At

I used yo keystone to generate a keystone webpage and basically what I want is to sort of feature galleries on the homepage. I added the line

view.query('galleries', keystone.list('Gallery').model.find().sort('sortOrder'));

to my index.js file in the routes/views folder and basically copied the gallery.jade file into index.jade so that I could make sure the page could find "galleries" but when i try to open the page, i get the error that "galleries" is undefined.

I have also tried adding this bit of code to the same index.js

locals.data = {
    galleries: keystone.list('Gallery').model.find().sort('sortOrder');
};

and calling data.galleries in index.jade but it didn't work either. How do I get this gallery list on my jade file?

1

There are 1 answers

0
Angie On BEST ANSWER

Turns out that my original change with view.query was correct. I just needed to restart my database.