Pages

Thursday, December 8, 2011

SyntaxHighlighter for RedDot

Just want to share the RedDot syntax for SyntaxHighlighter. Please no hotlinking. I only have limited bandwidth per month.

Files to include on HTML page:
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='https://sites.google.com/site/simplyreddot/shBrushRedDot.js' type='text/javascript'></script>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<link href='https://sites.google.com/site/simplyreddot/shCoreRedDot.css' rel='stylesheet' type='text/css'/>
<script type='text/javascript'>
 SyntaxHighlighter.all();
</script>

Case escape HTML code in:
<pre class="brush: RedDot">
...
</pre>

Managing JS CSS XML as content classes in 10.1

Problem

Management Server treats all page instances as HTML pages and like to search for <head> and <body> tag to inject javascript code into them.  The issue is most noticeable in version 10.1.
If <head> and <body> tag are not found, MS injects those tags along with javascript snippets to the top of the page.
For CSS and JS pages managed in MS and linked via anchor, this invalidates the CSS and JS, hence user would notice some CSS styles not being applied, and JS library/function not loaded.

Solution

Include this code at the bottom of any CSS or JS content class that have page instances referenced/connected via anchor in NOT Publish Mode to avoid invalidation.
/** <html><he<!IoRangeNoRedDotMode><!/IoRangeNoRedDotMode>ad></head><body></body></html> **/

Wednesday, December 7, 2011

Navigation Emulation

What is it?

Allow a page, even a non navigation page, to display the exact navigation area as displayed on any page.

Why is it useful?

When a page is not in navigation manager, the page cannot display navigation because it is not part of navigation manager.

However, a page should not be in navigation manager simply because it needs to display navigation. For example, news article pages should not be in navigation manager because number of navigation pages in navigation manager negatively impacts project performance.

However, news article pages must display navigation area for the shake of accessibility. Hence, news article page can use navigation emulation to emulate the navigation of its parent page, the new archive page.

Simple Method

<!IoRangeDynLink>
<!IoRangeNoRedDotMode><!IoRangeRedDotMode><%anc_link%><!/IoRangeRedDotMode><!/IoRangeNoRedDotMode>
<%!! Navigation:OutputArea(LeftNavArea, Bool:True, Guid:<%inf_page_guid%> !!%>
<!/IoRangeDynLink>

 Advanced Method

<reddot:cms>
 <if>    
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- This Page is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage.MainLink.OwnerPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- The Page 1 Level Up is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.MainLink.OwnerPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- The Page 2 Levels Up is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- The Page 3 Levels Up is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- The Page 4 Levels Up is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
  <query valuea="Context:Indexes.GetIndexByPage(Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage).GetRootIndex().Id" operator="==" valueb="Context:Indexes.RootIndexList[Int:0].Id">
   <!-- The Page 5 Levels Up is in Navigation Structure -->
   <htmltext>
    <%!! Navigation:OutputArea(Left Navigation, Bool:False, Context:CurrentMasterPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.MainLink.OwnerPage.Id, Bool:False) !!%>
   </htmltext>
  </query>
 </if>
</reddot:cms>

What a project start page should look like


  1. Start page should never be a navigation page
  2. Anchor should be used instead of list because anchor allows individual publication package, authorization, and workflow for each section.
  3. CSS and JS should never be connected directly to a page.  They should only be connected to one location and referenced by other pages.