Creating an instance of a jQuery Mobile Page - oop

I'd like be able to create instances of jQuery mobile pages using an existing jQuery Mobile page as a template. Can anyone point me in the right directing on this. Does anything exist along the lines of:
var pageInstance = new $mobile.createPage();

If you sure your page is currently loaded into the DOM.Try with this,
var page = $('#PageId');

Related

Nested Routes in Gridsome?

In Gridsome, I am basically looking for Vue's nested route functionality (or Nuxt's child-view) to achieve something like this /:userId/profile and /:userId/posts for example. And since Gridsome uses Vue Router there should be a way to achieve this I believe
Let me try to explain what I am trying to build with Gridsome:
At mywebsite.com/ I want to show a Grid of images showing thumbnails of my video portfolio. When you then click on a thumbnail I want a modal to pop-up showing the video. The modal is semi transparent showing the portfolio in the background. So far so good.
But for people to be able to share the URL of the respective video, I need the path changing to mywebsite.com/video-1 and so on. When I then close the modal the path should be mywebsite.com/ again. This is something I already achieved within Nuxt with <child-view>.
Is there some similar functionality in Gridsome? I appreciate your help.
From the feedback you got here:
Gridsome doesn't support child routes yet. But you can kind of achieve what you want if you create a new content type called User and add each user as a node. Then generate pages for them with the Pages API. The pages you create can share a layout component.
In the same way, you can also generate pages for each video for having direct URLs to them. And use the $fetch() method to load a video in a pop-up. Or just query the videos in the front-page query instead of using $fetch().

Accessing global site regions in Piranha CMS

I have added a global site region to my site and filled it with some content. How can I read this content from page view and/or layout?
This feature differs a bit between WebPages & MVC, the reason for this being that in WebPages (like WebForms) a Layout-page have a different model than the actual page being executed. If you use WebPages you simply add the following line first in the Layout page:
#inherits Piranha.WebPages.LayoutPage
This will automatically load the layout page model and all the global regions.
If you're using MVC this can't be done automatically as the Layout doesn't have a model. You can simply add the following in your Layout-page:
#{
Piranha.Models.PageModel global;
if (HttpContext.Current.Items["Piranha_CurrentPage"] != null) {
var current =
(Piranha.Models.Page)HttpContext.Current.Items["Piranha_CurrentPage"];
global = Piranha.Models.PageModel.GetBySite(current.SiteTreeId);
} else {
global = Piranha.Models.PageModel.GetBySite(Piranha.Config.SiteTreeId);
}
}
This snippet loads the layout page from:
If it's a page is displayed it loads the site tree the page is contained in
If it's a post it loads the site tree from the current site.
Hope this helps you!
Regards
/HÃ¥kan

How to navigate between different html pages in Windows 8 Metro application using javascript?

How can i navigate between different html pages using javascript?
I tried to use the below statement but it's not working. I have added a breakpoint and found that the below statement is executed.But still It doesn't display the page2.html.
WinJS.Navigation.navigate("page2.html", null);
Can anyone tell me why in what all scenarios it won't work ?
One option I found was iframe which I haven't tried yet.
This API isn't a specific page navigator; it's about loading the location as defined by the location service in WinJS:
http://msdn.microsoft.com/en-us/library/windows/apps/hh452768.aspx has the details on the specifics of using that model.
That stated, if you wish to use the normal Web model of a new page, either a normal link, or setting the window.location to the other page will cause a browser navigate.

Running multiple extjs4 apps on a liferay portal page

I'm using liferay portal for a website. All of my portlets are based on Extjs4 MVC framework. The problem is that when I add multiple Extjs4 based portlets to a page one of them won't load. I experimented with the app.js files of the apps. and found out that when I added the initialization code to one of the portlets all of them starts running.
for example following code works,
Ext.Loader.setPath('Ext', '/loc-treeview-portlet/loc-treeview/ext-4.0/src');
//loader path for the first app
Ext.Loader.setPath('LocTree', '/loc-treeview-portlet/loc-treeview/app');
//loader path for the second app
Ext.Loader.setPath('ServiceTree', '/service-layer-portlet/service-treeview/app');
// Instantiate the apps which I have created by extending Ext.app.Application
Ext.create('LocTree.app.LocTreeApplication');
Ext.create('ServiceTree.app.ServiceTreeApplication');
But I can't do this in the actual portal because it's not known in advance which of the extjs4 apps will be in the page. Does any body have any idea of how to get these apps to work independently?
Perhaps you can extract the Application definition into the page template that way you know there is only one App launch event. Then each portlet is essentially a view with its own controller. You will need to call init() manually on the controllers though.
The problem seems to be that document 'ready' event in ExtJS4 only initializes one app(portlet) in a given page. So what I did was to wrap all the code app.js file in an AUI().ready() call.
AUI().ready(function(){
// all app.js code here
});

Logo for each site in site collection

I want to load different logo in each site in same site collection. For now my logo tag exists in master page. Any idea ?
You can do 2 things.
You can replace the SharePoint:SiteLogoImage with your own.
You can use Master.FindControl to find that control by doing the following
var siteLogo = (SiteLogoImage)Page.Master.FindControl("ID of control goes here");
siteLogo.LogoImageUrl = // Insert logo img url here
If you are using ASP Dot NET then we can have more than one master page, defining logo for each one. You can call you master page at run time according to your site opened!
Please would you specify Are you using ASP DOT NET or defining master page in another lange