Yes, even though you can access the current view using JavaScript,
your code will generally be much more maintainable if you use multiple
Content sections as Frisoni suggests.

See this link for more info.:
http://code.google.com/p/opensocial-resources/wiki/MultipleContentSections

- Jason

On Aug 21, 6:22 am, Frisoni <[EMAIL PROTECTED]> wrote:
> Just remembering, you can separated your code in XML file also...
>
> <Content type="html" view="profile">
>   ###profile content
> </Content>
> <Content type="html" view="canvas">
>   ###canvas content
> </Content>
>
> Frisoni
>
> On Thu, Aug 21, 2008 at 10:14, Ramanpreet Singh <[EMAIL PROTECTED]>wrote:
>
>
>
> > Hey Peps
>
> > Try this
> >            var currView = gadgets.views.getCurrentView().getName();
> >                if (currView)
> >                {
> >                    if (currView == "canvas")
> >                    { ; }
> >                    else if (currView == "profile")
> >                    { ; }
> >                    else
> >                    { ; }
> >                }
> > And remember, before you can do this..
> > you would have to add <Require feature="views"/> in your moduleprefs
> > section.
> > All the best.
>
> > peps wrote:
> > > Hi,
> > > I'm pretty much a beginner in opensocial-applications so I have a
> > > beginners question:
>
> > > How to use
> > > gadgets.views.getCurrentView()
> > > and
> > > gadgets.views.requestNavigateTo(view)
> > > to make the application display the correct content depending if the
> > > user is in canvas or profile page..?
>
> > > Would something like this work? (i can't get to the orkut sandbox yet
> > > so can't really test it..)
>
> > > if ( gadgets.views.getCurrentView() == "canvas" ){
> > >   // canvas code here
> > > }
> > > else{
> > >   // profile code here
> > > }
>
> > > Thank you for any replies,
> > > p
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to