hapi icon indicating copy to clipboard operation
hapi copied to clipboard

Reply view options

Open davidchase opened this issue 12 years ago • 4 comments

Hi, So I am trying to override or add the partialsPath from the reply.view() :

  reply.view('./basket/views/index', {
            basket: data
   }, {
           partialsPath: './client/src/basket/views/'
   });

But I get a handlebars error.

My config looks like this

 views: {
                engines: {
                    hbs: require('handlebars')
                },
                path: './client/src/',
                layoutPath: './client/src/common/',
                layout: true
            }

if i add partialsPath: './client/src/basket/views/' to the above views object it works but I thought I could do it through the reply.view method

Any help is greatly appreciated

-David

davidchase avatar Aug 13 '14 00:08 davidchase

You cannot specify additional helpers or partials per view. Only when setting up the views manager.

hueniverse avatar Aug 13 '14 03:08 hueniverse

@hueniverse Is there a way I can point to different partialsPaths? since my partials live in a views directory which live in their own module something like this

basket
└── views
    ├── index.hbs
    ├── index.js
    └── partial.hbs

and the shipping module has a similar structure.

thanks

davidchase avatar Aug 13 '14 11:08 davidchase

nevermind i got it :+1: thanks again

davidchase avatar Aug 13 '14 13:08 davidchase

Hi @davidchase , I'm also trying to do this. Can you post your solution?

benkermode avatar Feb 09 '17 17:02 benkermode