Advertisement
Guest User

Untitled

a guest
May 25th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var keystone = require('keystone');
  2. var Product = keystone.list('Product');
  3.  
  4. exports = module.exports = function (req, res) {
  5.  
  6.     var view = new keystone.View(req, res);
  7.     var locals = res.locals;
  8.     locals.filters = {
  9.         product : req.params.product
  10.     }
  11.  
  12.  
  13.     // locals.section is used to set the currently selected
  14.     // item in the header navigation.
  15.     locals.section = 'store';
  16.     view.query('products', keystone.list('Product').model.find());
  17.  
  18.     // Render the view
  19.     view.render('store');
  20. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement