[ 6 posts ]

Szymon J

  • Username: szym
  • Joined: Thu Jun 14, 2012 7:03 am
  • Posts: 6
  • GitHub: sjuchno
  • Gists: sjuchno
  • Offline
  • Profile

Rendering multiple views on server and client

Post Posted: Wed Jun 20, 2012 1:08 am
+0-
I'm new to node/expres and yui app framework so this may be trivial.
I want to create app that consists of two or more panels which are separate views. For example you have products list on the left and selected product details on the right. Page should be rendered by server on initial load (to satisfy search engines) and then all browsing should be handled with pjax (all urls should also render without javascript on the server). With javascript enabled selecting some other product in the left panel should change only content of the right panel. Changing directory should influence both panels. Without javascript whole page reloads.
Multiple views on the client are covered in github example and also here
viewtopic.php?f=92&t=10123
but how to render those multiple view pages server side?
Is this doable with yui app framework?
Even simple 'yes' or 'no' would be of some help.
Thanks in advance.

Szymon J

  • Username: szym
  • Joined: Thu Jun 14, 2012 7:03 am
  • Posts: 6
  • GitHub: sjuchno
  • Gists: sjuchno
  • Offline
  • Profile

Re: Rendering multiple views on server and client

Post Posted: Wed Jun 20, 2012 6:07 am
+0-
Is my question not clear, stupid or am approaching this issue in a wrong way? Come on guys I need some feedback here.

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 617
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile

Re: Rendering multiple views on server and client

Post Posted: Wed Jun 20, 2012 8:53 am
+0-
Yes, the YUI App framework is designed to render in the server as well. Unfortunately there isn't a simple example of it in the docs, but you can look at Eric's http://photosnear.me/ site. Its code is on github: https://github.com/ericf/photosnear.me

Marc

YUI Contributor

  • Offline
  • Profile

Re: Rendering multiple views on server and client

Post Posted: Wed Jun 20, 2012 10:50 am
+0-
I think you could use a server side handlebars renderer and a shared handlebars code base that is delivered by the YUI loader, as well as used by the serverside environment to render the relevant page fragments. This also came up in a YUI forum discussion about the mobile vision of YUI. Photosnear me assumes NodeJS as the server, but most people work in php, java, C#, so with a server side handlebars renderer, you should be good to go. There is a new Handlebars server engine on the verge of coming out in Java. I'm sure there will be equal efforts on the php side available

Szymon J

  • Username: szym
  • Joined: Thu Jun 14, 2012 7:03 am
  • Posts: 6
  • GitHub: sjuchno
  • Gists: sjuchno
  • Offline
  • Profile

Re: Rendering multiple views on server and client

Post Posted: Thu Jun 21, 2012 1:22 am
+0-
Ok. Now I see that my question is probably to general. I'll post a new topic describing exactly where I'm stuck so it should be much easier to answer. Thanks guys.

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: Rendering multiple views on server and client

Post Posted: Thu Jun 21, 2012 5:27 am
+0-
We did an Open Hours where we discussed how I shared the templates used by Photos Near Me between the server and browser. You might be interested in watching the recording:
http://www.youtube.com/watch?v=Bjs7b8sksO4&hd=1
  [ 6 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum