 <?xml-stylesheet type="text/css" href="https://i7media.com/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="https://i7media.com/Data/style/rss1.xsl" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
  <channel>
    <title>Blog</title>
    <link>https://i7media.com/blog</link>
    <description />
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>mojoPortal Blog Module</generator>
    <language>en-US</language>
    <ttl>120</ttl>
    <atom:link href="https://i7media.com/Blog/RSS.aspx?p=50~99~9" rel="self" type="application/rss+xml" />
    <itunes:owner />
    <itunes:explicit>no</itunes:explicit>
    <item>
      <title>Ultimate mojoPortal Upgrade Guide</title>
      <description><![CDATA[<p>Due to its structure, upgrading mojoPortal is quite simple. The short story is you backup your site and database, download the new version, copy the files to your server, open the setup page and you're done. There are a few areas where one might start over thinking the process and make it harder than it really is so we decided we would write this guide to help quell the desire to make it difficult.</p>

<div class="alert alert-warning"><strong>THE GREAT BIG WARNING:</strong> If you do not backup your website and its database you are asking for trouble. While we have never had an upgrade break a site, it could happen and having a backup is the only way to insure yourself against it.</div>

<h3>The Canon</h3>

<p>The process for upgrading mojoPortal is no different if you are upgrading from a really old version or a relatively new version. mojoPortal doesn't have "minor" updates or "major" upgrades. The terms update and upgrade can be used interchangeably when referring to mojoPortal. Version numbers don't mean much, version 2.4.0.0 didn't necessarily contain any more new features or bug fixes than 2.3.7.2. The version numbers increase by 0.0.0.1 each time a database change or a set of database changes is needed. There are never "upgrade" or "update" packages released by mojoPortal. All releases packages&nbsp;contain a full installation which if&nbsp;copied to an existing site will upgrade the site.&nbsp;<strong>If you do not backup your site and database before upgrading, you are not being responsible.</strong></p>

<h3>Process Overview</h3>

<ol>
	<li>Take the Site Offline</li>
	<li>Backup the Site Files and Database</li>
	<li>Prepare the web.config File</li>
	<li>Copy New Files to the Site</li>
	<li>Bring the Site Online</li>
	<li>Run the Setup Page</li>
	<li>Make Skin Changes if Needed</li>
</ol>

<h3>Take the Site Offline</h3>

<p>You want to do this prior to backing up the site because once the site is offline, no one can make any changes to it. If you were to backup the site before taking it offline, someone could make a change which is not backed up.</p>

<p>To take the site offline, add an "App_Offline.htm" file to the root of the site. <em>The root of the site is the same location where the web.config file resides.</em> <a href="https://i7media.net/SharedFiles/Download.aspx?pageid=6&amp;mid=9&amp;fileid=402" rel="nofollow">You can download an example App_Offline.htm here</a>.</p>

<h3>Backing up</h3>

<p>There are many, many ways to backup files and databases. We will cover two methods for backing up files and two methods for backing up databases (one for MSSQL and one for MySQL).</p>

<h4>Backing up Files When You Have Access to the Server's Desktop</h4>

<p>Use this method if you have access to the servers desktop. If you don't have access to the servers desktop, use the FTP method.</p>

<p>In general, you will want to browse to the location of your site files. If you do not know what this is, you should contact your server admin or, if you are familiar with IIS, check the physical path for the site in IIS. Once you have located the site files, select all of them and create a zip file of them. We use <a href="http://7-zip.org/">7-Zip</a> but you can use whatever you like.</p>

<h4>Backing up Files with FTP</h4>

<p>Download a <strong>good</strong> FTP client which provides verbose logging and an easy way to retry operations which may have failed. We use <a href="https://filezilla-project.org/">FileZilla</a> and recommend it above any other FTP client.</p>

<p>Open your FTP client and connect to your server. Download <strong>all</strong> of the files in your site to a directory on your computer. Check the FTP Client's log for any failures and re-download any files which did not download properly.</p>

<h4>Backing up MSSQL Database in SQL Server Management Studio</h4>

<p>Use this method if you have access to the database using SQL Server Management Studio (SSMS). Some hosting providers provide this access but the more security minded hosting providers (like i7MEDIA) do not. If you cannot access the database with SSMS, use your hosting providers control panel tools to back up your database. If you are an i7MEDIA customer, follow the instructions in our "<a href="http://i7media.net/clients/knowledgebase/145/Backing-up-and-Restoring-SQL-Server-Databases.html">Backing up and Restoring SQL Server Databases</a>" knowledge base article.</p>

<h4>Create the Backup</h4>

<ol>
	<li>Open SSMS and connect to the database server hosting the database.</li>
	<li>Right-click the database in the Object Explorer of SSMS and then select Tasks &gt; Back Up. For further instructions, read the "<a href="http://technet.microsoft.com/en-us/library/ms187510.aspx#SSMSProcedure">Create a Full Database Backup</a>" article on the MSDN website.</li>
</ol>

<h4>Backing up MySQL Database using MySQL Workbench</h4>

<p>Use this method if you have access to the database using MySQL Workbench. Some hosting providers provide this access but the more security minded hosting providers (like i7MEDIA) do not. If you cannot access the database with MySQL Workbench, use your hosting providers control panel tools to back up your database. Many hosting providers do provide access to a tool called <a href="http://www.phpmyadmin.net">PHPMyAdmin</a> which you can use to back up your database as well. If you are an i7MEDIA customer, follow the instructions in our "<a href="http://i7media.net/clients/knowledgebase/172/Backing-up-and-Restoring-MySQL-Databases.html">Backing up and Restoring MySQL Server Databases</a>" knowledgebase article.</p>

<h4>Create the Backup</h4>

<ol>
	<li>Open MySQL Workbench and connect to the database server hosting the database.</li>
	<li>Select "Data Export" under "Management" in the Navigator.</li>
	<li>Select the database in the "Object Selection" panel.</li>
	<li>Select your desired options in the Options section and click the "Start&nbsp;Export" button. Note: <strong>do not </strong>select the "Skip table data" option because you will not end up with any of your site data if you do select this option.</li>
</ol>

<h3>Prepare the web.config File</h3>

<p><strong>You should use the web.config file which comes with the mojoPortal release.</strong> This cannot be stressed enough because trying to compare every line of your old web.config file and the new one will take a long time and you may miss something.&nbsp;Nearly all of the settings you might change should be done in the user.config file anyway so you shouldn't have many changes to the web.config file in the first place. A few exceptions to this rule are listed below:</p>

<dl>
	<dt><strong>machineKey</strong></dt>
	<dd>The machineKey is used for encryption and decryption of authentication cookie data and view-state data. In mojoPortal it is also used for encryption and decryption of stored passwords if the Password Storage option is set to "Encrypted." You should copy this from your previous web.config file to the new web.config file. Read our "<a href="http://i7media.net/separating-sections-from-the-mojoportal-webconfig-file">Separating Sections From the mojoPortal web.config File</a>" article if you have a lot of sites and don't want to modify the new web.config for each of them.</dd>
	<dt><strong>Keys Related to Large File Uploads</strong></dt>
	<dd>The httpRuntime and requestFiltering elements in the web.config help with the support of large file uploads. If you have made changes to these elements, you will need to copy those changes to the new web.config file. Read the <a href="https://www.mojoportal.com/supporting-large-file-uploads.aspx">Supporting Large File Uploads</a> article in the mojoPortal documentation for more information on this topic.</dd>
	<dt><strong>Keys Related to Error Pages</strong></dt>
	<dd>The configuration of custom and http error pages for a website hosted in IIS is saved in the web.config file. If you have changed these settings from the default values, you'll need to copy them over to the new web.config file. The customErrors element contains the settings for handling .net related errors and the httpErrors element contains the settings for handling http errors (e.g., 404). Tip: take a look at our article "<a href="http://i7media.net/prettifying-the-mojoportal-error-page">Pretifying the mojoPortal Error Page</a>" for information on how to modify the .net error page.</dd>
</dl>

<p>If you have several items which cannot go in the user.config file, you should keep them saved in some kind of notes file with the site. For best security, save your notes file with a .config extension to prevent it from being download via the web.</p>

<p>Note: this is an upgrade, not a new install so you <strong>should not</strong> copy create a new user.config file.</p>

<h3>Copy New Files to the Site</h3>

<p>If you have access to the servers desktop you can simply copy the files from the release (with changes made to the web.config) to the location of your site files in the order listed below. When prompted to with the option&nbsp;merge existing folders or not, select "yes." When prompted to "Copy and Replace" for existing files or "Don't copy,"&nbsp;check the "Do this for all conflicts" checkbox and then click the "Copy and Replace" option.</p>

<p>If you are accessing the site with FTP, again be sure you are using a good FTP client. Using the FTP client, upload all of the files in the order listed below. When prompted to overwrite existing files, choose whichever option overwrites the existing files.</p>

<h4>Order to Copy or Upload New Files/Folders</h4>

<ol>
	<li>Setup folder</li>
	<li>ClientScript&nbsp;folder</li>
	<li>Data folder</li>
	<li>All other files and folders</li>
</ol>

<h3>Bring the Site Online</h3>

<p>The site was taken offline by adding the App_Offline.htm file to the root of the site. To bring the site back online, all you need to do is rename or move the file. We generally customize our App_Offline.htm files with customer logos so we simply rename the file to App_Offline.config instead of moving it elsewhere.</p>

<h3>Run the Setup Page</h3>

<p>The setup page runs all of the database scripts for all of the features which have database changes. It also processes all of the feature configuration files which control what settings you see on the settings page for module instances.</p>

<p>To run the setup page, open a web browser and go to http://www.yourwebsite.url/Setup/Default.aspx. Once all of the scripts run, you will see a summary at the bottom of the page along with a link to the site.</p>

<p>If you see any errors, you will need to address them. Generally, you shouldn't see any errors but we have compiled a short list of the most common errors.</p>

<dl>
	<dt><strong>Setup is disabled. To continue, please set DisableSetup to false in Web.config.</strong></dt>
	<dd>This is showing up because the DisableSetup key in the web.config or user.config file has been set to true. If you were logged in to the site prior to upgrading, you will not see this error. To get around this, open the user.config file and change the setting to false. Next, open the web.config file and add a space to the bottom of the file. Finally, reload the setup page.</dd>
	<dt><strong>The system cannot connect to the MSSQL database. Please check your connection string.</strong></dt>
	<dd>The Connection String key in the user.config file is not correct. This error is always accompanied by more detailed information to help you troubleshoot the problem. If the database server can be accessed, it will state something to the effect of "...error occurred while establishing a connection..." If the database name, username or password is incorrect, it will state something to the effect of "the login failed."</dd>
</dl>

<h3>Make Skin Changes if Needed</h3>

<p>The skins in the mojoPortal release packages are not copied over the skins used by sites (located in \Data\Sites\[sitenum]\skins). The skins located \Data\Skins are updated or appended with the updated or new files from the release package. If you are using a skin which came with mojoPortal and have not modified it, you can copy it from \Data\Skins to \Data\Sites\[sitenum]\skins.</p>

<p>If you are using a custom skin or you have modified a packaged skin, you should check the "<a href="https://www.mojoportal.com/important-skin-changes">Important Skin Changes</a>" article in the mojoPortal Documentation for details on any changes you need to make to your skin to support the new release. You will want to check the details of every version between your old version and the new version you are installing. This is rather easy as the changes are listed in descending order in the article and there aren't very many.</p>

<h3>Summary</h3>

<p>See, it's rather simple. You don't need to worry about database scripts, different methods for minor or major versions, lots of file merging or anything like that. Really, all you need to do is create a backup and copy over the new files.</p>

<p>If you run into problems, check out the <a href="https://www.mojoportal.com/forums">mojoPortal Forums</a>. Do a search for your issue before posting because someone else may have already reported the problem and resolution has been provided by the community.</p>

<h3>Want someone else to do it?</h3>

<p>If you would rather have someone else handle upgrades for you, check out our <a href="http://i7media.net/mojoportal-upgrade-service">Upgrade Service</a>.</p>

<h3>Want to learn more about mojoPortal?</h3>

<p>If you enjoyed this guide and would like to learn more about mojoPortal, check out our <a href="http://i7media.net/mojoportal-training">Training Classes</a>.</p>
<br /><a href='https://i7media.com/ultimate-mojoportal-upgrade-guide'>Joe Davis</a>&nbsp;&nbsp;<a href='https://i7media.com/ultimate-mojoportal-upgrade-guide'>...</a>]]></description>
      <link>https://i7media.com/ultimate-mojoportal-upgrade-guide</link>
      <author>joe@i7media.net (Joe Davis)</author>
      <comments>https://i7media.com/ultimate-mojoportal-upgrade-guide</comments>
      <guid isPermaLink="true">https://i7media.com/ultimate-mojoportal-upgrade-guide</guid>
      <pubDate>Fri, 06 Dec 2013 00:00:00 GMT</pubDate>
    </item>
    <item>
      <title>Hide Module Settings and Edit Links</title>
      <description><![CDATA[<p>One of the things that most of our users like the most about mojoPortal is the easy access they have to module settings and edit screens. Sometimes, people ask if they can hide these links (or icons if the skin uses those) while remaining logged into the site.</p>

<p>Well, here's an extremely easy way to hide the links without sacrificing the usability of mojoPortal. This solution is completely skin based so it doesn't require any additions to the mojoPortal core.</p>

<p>First, we add the following to our skin script (see "<a href="https://i7media.net/optimize-your-mojoportal-skin-scripts">Optimize Your mojoPortal Skin Scripts</a>" for more info):</p>

<pre class="language-javascript linenums" data-rel="scripts.js">
<code>function HideEditLinks() {
	$(".modulelinks").hide();
	$(".ModuleEditLink").hide();
}

function ShowEditLinks() {
	$(".modulelinks").show();
	$(".ModuleEditLink").show();
}

$(document).ready(function() {
	var editLinksState = Get_Cookie('editLinksState');
	if (editLinksState != null) {
		if (editLinksState == 'hidden') {
			HideEditLinks();
		}
		if (editLinksState == 'visible') {
			ShowEditLinks();
		}
	}

	$("a#togglemodulelinks").click(function() {
		editLinksState = Get_Cookie('editLinksState');
		if (editLinksState == null || editLinksState == 'visible') {
			HideEditLinks();
			Set_Cookie('editLinksState', 'hidden')
		} else if (editLinksState == 'hidden') {
			ShowEditLinks();
			Set_Cookie('editLinksState', 'visible')
		}
	});
});</code></pre>

<p>Second, we add the following inside the AutoHidePanel in the layout.master:</p>

<pre class="language-markup">
<code>&lt;a href="#" rel="nofollow" id="togglemodulelinks"&gt;Toggle Edit Links&lt;/a&gt;</code></pre>

<p>The code above simply hides the links if they're shown and displays them if they're hidden.</p>

<p>Placement of the "Toggle Edit Links" link can be done with CSS but it should definitely be inside of the <code>AutoHidePanel</code>. The <code>AutoHidePanel</code> will ensure that the link isn't shown unless one of the Admin Toolbar items is shown. You could add another <code>AutoHidePanel</code> to the layout.master but there's no point in increasing page load if you don't have to.</p>

<p>Happy mojo-ing!</p>
<br /><a href='https://i7media.com/hide-module-settings-and-edit-links'>Joe Davis</a>&nbsp;&nbsp;<a href='https://i7media.com/hide-module-settings-and-edit-links'>...</a>]]></description>
      <link>https://i7media.com/hide-module-settings-and-edit-links</link>
      <author>joe@i7media.net (Joe Davis)</author>
      <comments>https://i7media.com/hide-module-settings-and-edit-links</comments>
      <guid isPermaLink="true">https://i7media.com/hide-module-settings-and-edit-links</guid>
      <pubDate>Mon, 11 Jun 2012 03:03:00 GMT</pubDate>
    </item>
    <item>
      <title>Optimize your mojoPortal Skin Scripts</title>
      <description><![CDATA[<p>Almost every single skin we develop uses a couple JavaScript scripts, but even the addition of one script can slow the speed of a website. We use a fairly simple process to combine as many of our scripts into one file and then using a neat mojoPortal control, we add that script the combined site script. The combined site script contains most of the scripts mojoPortal uses for things like site cookies, ASP.NET&nbsp;CSS friendly adapters, etc… This process will result in fewer files being delivered to the browser, thus improving performance (somewhat).</p>

<h3>Create the Skin Script and call it from the <code>layout.master</code></h3>

<ol>
	<li>Create a new js file in your skin directory, I usually name it skinscript.js.</li>
	<li>Add your javascript to the new file. Don't use <code class="language-markup">&lt;script&gt;</code> tags, you don't need them in javascript files.</li>
	<li>Add the following&nbsp;to your&nbsp;<code>layout.master</code>. I usually add this right after the&nbsp;<code class="language-markup" style="word-spacing: 0px;">&lt;asp:ScriptManager</code>&nbsp;control.
	<pre class="language-aspnet">
<code>&lt;portal:SkinFolderScript ID="sfs1" runat="server" ScriptFileName="skinscript.js" AddToCombinedScript="true" /&gt;</code></pre>
	</li>
</ol>

<h3>Copy all the scripts from your layout.master to the Skin Script</h3>

<p>This is the part that can be a little bit tricky because not all scripts are going to work properly when combined with other scripts. If you copy the scripts to your new file one at a time and test the result, you'll find those pesky ones that will not cooperate. Just leave them in the layout.master, or if you're feeling froggy, rewrite them so they can be combined.</p>

<h4>A note about SuperFish</h4>

<p>Most of our skins use a SuperFish menu but the scripts for the SuperFishmenu come in two parts. One is the static script that is in the ClientScript&nbsp;directory which contains all of the SuperFish&nbsp;magic. The other is an initialization script that is loaded in the <code>layout.master</code> of the skin. Typically, these are loaded by adding the <code>layout.master</code> a <code class="language-markup">&lt;portal:SiteScript</code> control to load the main SuperFish script and then a <code class="language-markup">&lt;script&gt;</code> element with a bit of jQuery to initialize the SuperFish menu. We decided to use the jQuery <code class="language-javascript">.getScript()</code> method to load the main script from our Skin Script. Using this method allows us to initialize the SuperFish menu only if the main script is loaded properly.</p>

<h3>A Sample Skin Script</h3>

<p>The script below is what we use for starting our skin scripts. It includes the JavaScript for the Administration Toolbar Menu, SuperFish Menu and a neat bit of jQuery that will give the "Add File" button in the Shared Files module a hover state. The script is written out long-form so you can easily see what it does. I suggest that you minify the script before using it in production.</p>

<pre class="language-javascript linenums" data-rel="scripts.js">
<code>//  ========== 
//  = This file stores all of the scripts that would normally be placed inside the layout.master
//  = Use the following syntax for referencing this script from the layout.master.
//  = <portal:skinfolderscript addtocombinedscript="true" id="sfs1" runat="server" scriptfilename="skinscript.js">
//  ==========

/*Standard JavaScript */

function HideMenuToolbar() {
	$("#toolbar").fadeOut();
	$("#toolbarbut").fadeIn("slow");
}

function ShowMenuToolbar() {
	$("#toolbar").fadeIn();
	$("#toolbarbut").fadeOut("slow");
}


/* jQuery Scripts */
$(document).ready(function() {

	/* Admin Toolbar */
	$("span.downarr a").click(function() {
		HideMenuToolbar();
		Set_Cookie('openstate', 'closed')
	});
	$("span.showbar a").click(function() {
		ShowMenuToolbar();
		Set_Cookie('openstate', 'open')
	});
	$("span.downarr a, span.showbar a").click(function() {
		return false;
	});
	var openState = Get_Cookie('openstate');
	if (openState != null) {
		if (openState == 'closed') {
			HideMenuToolbar();
		}
		if (openState == 'open') {
			ShowMenuToolbar();
		}
	}

	/* Superfish Menu */
	/* Get Superfish mojoPortal Script */
	$.getScript("/ClientScript/jqmojo/mojosuperfish.js", function() {
		$("ul.sf-menu").supersubs({
			minWidth: 1,
			maxWidth: 27,
			extraWidth: .2
		}).superfish({
			pathClass: 'current',
			pathLevels: 0,
			delay: 500,
			animation: {
				opacity: 'show',
				height: 'show'
			},
			speed: 200,
			dropShadows: false,
			autoArrows: true
		});
	});
	/* This will make the Shared Files "Add File" button have a hover state */
	$("div.uploadpanel &gt; div &gt; input + div + div").hover(
		function() {
			$("div.uploadpanel div .jqbutton").addClass("ui-state-hover")
		},
		function() {
			$("div.uploadpanel div .jqbutton").removeClass("ui-state-hover")
		});
});</portal:skinfolderscript></code></pre>

<h3>Further Reading</h3>

<p>If you're serious about optimizing the speed of your mojoPortal site, I highly suggest you read the "<a href="http://www.mojoportal.com/improving-your-yslow-or-page-speed-score">Improving Your YSlow or Page Speed Score</a>" article in the mojoPortal Documentation.</p>

<p>Happy mojo-ing!</p>
<br /><a href='https://i7media.com/optimize-your-mojoportal-skin-scripts'>Joe Davis</a>&nbsp;&nbsp;<a href='https://i7media.com/optimize-your-mojoportal-skin-scripts'>...</a>]]></description>
      <link>https://i7media.com/optimize-your-mojoportal-skin-scripts</link>
      <author>joe@i7media.net (Joe Davis)</author>
      <comments>https://i7media.com/optimize-your-mojoportal-skin-scripts</comments>
      <guid isPermaLink="true">https://i7media.com/optimize-your-mojoportal-skin-scripts</guid>
      <pubDate>Tue, 31 Jan 2012 16:37:00 GMT</pubDate>
    </item>
  </channel>
</rss>