mystor / meteor-device-detection

(NO LONGER SUPPORTED) Client-Side Device Type Detection & Template Switching with Optional Meteor-Router Support
MIT License
69 stars 17 forks source link

Iron-Router support #8

Open gerwinbrunner opened 9 years ago

gerwinbrunner commented 9 years ago

Hi,

is there a way to use meteor-device-detection with iron router? It does not seem to pick up "_phone" templates automatically. Is there a way to get this working?

Thanks, Gerwin

mystor commented 9 years ago

Meteor device detection only does automatic template redirection when used with the meteor-router project. I haven't made a binding to hook into the iron router rendering process.

You should be able to do this automatically by adding {{> deviceRender 'template_name_here'}} into the template rendered by iron-router.

I would also accept a pull request which added iron-router support.

gerwinbrunner commented 9 years ago

Thanks for your reply. I could look into adding the iron-router support. Could you please direct me to where you see the best place to add this in the device-defection code.

mystor commented 9 years ago

It probably makes sense to add it into a separate file, like the device_helpers.js file. Possibly device_ironrouter.js or similar. I haven't looked into what is necessary at all, so I am not sure.

justindra commented 9 years ago

Just submitted a pull request. It was a pretty simple fix. It would be great if someone can test other devices other than phone and desktop/web.

Cheers!

t3db0t commented 9 years ago

Any chance this pull request is going to get... pulled?

CarlQLange commented 8 years ago

:+1: