Buck Anderson's DotNetNuke Training and Resource Center - how to profit with DotNetnuke August 27, 2008   
 You Are Here: ..:: DNN Modules » XMod Applications ::.. Register  Login
JOIN TODAY!  

Gain immediate access to all our articles, features, downloads, resaleable software applications, how-to's, video tutorials, discussion group, archives plus more.

Click here for details


Product Showcase  
DNN Modules  
Get Started  
Training  
Resources  
Features  

XMod | Training | Demonstrations | Downloads | Applications

XMod DemosXMod, a DotNetNuke® module created by DNNdev , is an extremely flexible and powerful tool. You can quickly create one-off solutions with little or no knowledge of HTML or programming. However, the more you know, the more you can do. Here's a sampling of what XMod can do.

Powerful XMod applications are available FREE to our subscribers in the DNN professor download library.

See you on the Inside
(Subscription Information)

 Membership has its advantages!


Current Articles | Categories | Search

 
How to Bookmark an Inline XMod Details Page
By Buck Anderson @ 1:09 PM :: 785 Views :: Article Rating :: Sample Articles, XMod Applications
 

Not that I am an advocate of the 'Bookmark' or 'Add to Favorites' type of links, but I had a challenge of creating a link that clients, using our Business Directory application, could use to point directly to their details page. Here is how I did it.

The challenge was to:

  1. Find a way to get the URL address of the XMod inline details page
  2. Link it as a bookmark that would work in most browsers including FireFox and Internet Explorer

The main hurdle was getting the routine to bookmark properly in FireFox. Most issues, with FireFox bookmarking, is the fact that the bookmark wants to add itself to the sidebar. After a few hours trying different scripts, I found that the one used below works on most browsers.

I discovered it at http://emanaton.com/coding/javascript/linkthispage.

I began by creating the following URL for my details page:

http://{XMOD_PortalAlias}/Resources/FindaVendor/tabid/
{XMOD_TabId}/xmmid/{XMOD_ModuleId}/xmid/<xmod:recordid/>/xmview/2/Default.aspx

Next, I added the following JavaScript to the top of the details page:

(Making sure it is placed above the final calling script)

<xmod:scriptblock scriptid="BookmarkScript" registeronce="true" blocktype="ClientScript">
<script type="text/javascript">
// http://emanaton.com/coding/javascript/linkthispage
function createBookmarkLink(url, title) {
try {
if (window.sidebar) { // Mozilla Firefox Bookmark
return window.sidebar.addPanel(title, url, "");
} else if( window.external ) { // IE Favorite
return window.external.AddFavorite( url, title);
} else if(window.opera && window.print) { // Opera Hotlist
return true;
}
} catch(err) {
// do nothing
}
alert('Could not create a bookmark on your client.\n\nTo return to ' + title + ' you must manually
create a bookmark to: \n' + url + '.');
}

function writeBookmarkLink(url, title) {
try {
if (window.sidebar) { // Mozilla Firefox Bookmark
return document.write('<a href="javascript:createBookmarkLink(\'' + url + '\', \'' + title + '\')");">
Create a Bookmark to <em>' + title + '</em></a>');
} else if (window.external) { // IE Favorite
return document.write('<a href="javascript:createBookmarkLink(\'' + url + '\', \'' + title + '\')");">
Add <em>' + title + '</em> to your Favorites</a>');
} else if (window.opera && window.print) { // Opera Hotlist
return document.write('<a rel="sidebar" href="' + url + '" title="' + title + '">
Create a Bookmark to <em>' + title + '</em></a>');
}
} catch(err) {
// do nothing
}
return document.write('To return to ' + title + ' create a bookmark to:
<a style="color: white;" href="' + url + '">' + url + '</a>');
}
</script>
</xmod:scriptblock>

An finally I created the Bookmark link:

<script>writeBookmarkLink(
'http://{XMOD_PortalAlias}/Resources/FindaVendor/tabid/{XMOD_TabId}/xmmid/{XMOD_ModuleId}
/xmid/<xmod:recordid/>/xmview/2/Default.aspx', '<xmod:field name="ListingTitle" />');</script>
<noscript>To return to <em><xmod:field name="ListingTitle" /></em> create a bookmark to:
<a href="http://{XMOD_PortalAlias}/Resources/FindaVendor/tabid/{XMOD_TabId}
/xmmid/{XMOD_ModuleId}/xmid/<xmod:recordid/>/xmview/2/Default.aspx">
http://{XMOD_PortalAlias}/Resources/FindaVendor/tabid/{XMOD_TabId}
/xmmid/{XMOD_ModuleId}/xmid/<xmod:recordid/>/xmview/2/Default.aspx</a></noscript>

How to Bookmark an Inline XMod Details Page. You can see it in action at:
http://dnnprofessor.com/marketplace.aspx

Happy coding,
Buck

 


Buck Anderson's DotNetNuke Training, Video Training, and Internet Marketing Resource Center DNNprofessor.com. Free tips to improve your business with DotNetNuke, XMod, website design techniques, and proven unconventional Internet Marketing Solutions that attract the attention of today's savvy Internet buyer at DNNprofessor.com.

© 2008 Jive Media Group LLC and Buck Anderson.
 All Rights Reserved. Reproduction without permission prohibited.


Rating

Click Next to View More Headlines

All articles available to Subscribers

 Membership has its advantages!

 
Copyright 2008 by Jive Media Group LLC. All Rights Reserved.  | Terms Of Use | Privacy Statement 

Page generated in 0.1092014 seconds. | powered byVisit Jive Media Group LLC