I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in mediasurface
My code is:
[HTML]<!-- start page container -->
<div id="pageContainer">
<!-- start middle content area -->
<div id="genericMiddle">
<div id="titleContainer">
<h1><%= requestItem.getFullName() %></h1>
</div>
[/HTML]
Expand|Select|Wrap|Line Numbers
- <%
- String sImportantMessage = "";
- try {
- sImportantMessage = requestItem.getFieldValue( "sImportantMessage" );
- } catch ( Exception e ) { }
- if ( sImportantMessage == null ) { sImportantMessage = ""; }
- if ( ( ! sImportantMessage.equals( "" ) ) )
- {
- out.print("<div id='importantMssgTop'><span class='importantMssgHeader'>" + sImportantMessage + "</span></div>");
- }
- String sIntroText = "";
- try {
- sIntroText = requestItem.getFieldValue( "sIntroText" );
- } catch ( Exception e ) { }
- if ( sIntroText == null ) { sIntroText = ""; }
- if ( ( ! sIntroText.equals( "" ) ) )
- {
- out.print("<div id='introductionText'>" + sIntroText + "</div>");
- }
- %>
- <!-- start column A-->
- <div id="columnA">
- <%
- String sMainFeatureTitle = "";
- try {
- sMainFeatureTitle = requestItem.getFieldValue( "sMainFeatureTitle" );
- } catch ( Exception e ) { }
- if ( sMainFeatureTitle == null ) { sMainFeatureTitle = ""; }
- if ( ( ! sMainFeatureTitle.equals( "" ) ) )
- {
- %>
- <div id="mainFeatureBox">
- <div id="mainFeatureText">
- <a href="<%=requestItem.getFieldValue( "sMainFeatureURL" ) %>">
- <img src="<%=requestItem.getFieldValue( "sMainFeatureImage" ) %>" alt="<%=requestItem.getFieldValue( "sMainFeatureAlt" ) %>" class="mainFeaturePhoto" align="left" border="0">
- </a>
- <div id="featureHeadline">
- <h2><a href="<%=requestItem.getFieldValue( "sMainFeatureURL" ) %>"><%= sMainFeatureTitle %></a></h2>
- </div>
- <%=requestItem.getFieldValue( "sMainFeatureText" ) %>
- </div>
- </div>
- <%
- }
- %>
- <div id="Column1">
- <%
- String sURL = ( "http://" + request.getServerName() + ":" + request.getServerPort() + requestItem.getFieldValue( "sURL" ) );
- %>
- <ms:getItem id="oCurrentItem" url="<%=sURL%>" />
- <%
- XXX_ItemOrderList oItemOrderList = new XXX_ItemOrderList( ms, ctx, oCurrentItem.getFieldValue( "orderlist" ) , oCurrentItem );
- IItem[] oChildItem = oItemOrderList.getItemLinks( );
- for ( int i = 0; i < oChildItem.length; i++ )
- {
- IItem oBoundItem = null;
- String sOutput = "";
- int j = 0;
- IItem oItemChildren = ms.getItem( ctx, oChildItem[i].getUrl() );
- if (oChildItem[i].getFieldValue("sFlash").equals("N"))
- {
- out.print("<div id='secondaryFeatureText'><a href='" + oChildItem[i].getFieldValue("sURL") + "'><img src='" + oChildItem[i].getFieldValue("sImage") + "' alt='" + oChildItem[i].getFieldValue("sAlt") + "' class='featurePhotoSecondary' align='right' border='0' height='60' width='60'></a><h3><a href='"+ oChildItem[i].getFieldValue("sURL") +"'>" + oChildItem[i].getFieldValue("sTitle") + "</a></h3>" + oChildItem[i].getFieldValue("sText") + "</div>");
- }
- else
- {
- out.print("<div id='secondaryFeatureText'>" + oChildItem[i].getFieldValue("sImage") + "<h3><a href='"+ oChildItem[i].getFieldValue("sURL") +"'>" + oChildItem[i].getFieldValue("sTitle") + "</a></h3>" + oChildItem[i].getFieldValue("sText") + "</div>");
- }
- }
- %>
- </div>
- <%
- String sNewsArchiveKey = "";
- try {
- sNewsArchiveKey = requestItem.getFieldValue( "sNewsArchiveKey" );
- } catch ( Exception e ) { }
- if ( sNewsArchiveKey == null ) { sNewsArchiveKey = ""; }
- if ( ( ! sNewsArchiveKey.equals( "" ) ) )
- {
- %>
Expand|Select|Wrap|Line Numbers
- <div id="Column2">
- <jsp:include page="/WEB-INF/templates/components/body/Common/News/newsNewGeneric.jsp" flush="true">
- <jsp:param name="maxResults" value="<%=requestItem.getFieldValue( "sNewsMaxResults" ) %>" />
- <jsp:param name="TitleText" value="News" />
- <jsp:param name="archiveKey" value="<%=sNewsArchiveKey %>" />
- </jsp:include>
- </div>
Expand|Select|Wrap|Line Numbers
- <%
- }
- %>
- </div>
- <!-- end column A -->
- <!-- start column 3-->
- <div id="Column3">
- <%
- String sQuickLinks = "";
- try {
- sQuickLinks = requestItem.getFieldValue( "sQuickLinks" );
- } catch ( Exception e ) { }
- if ( sQuickLinks == null ) { sQuickLinks = ""; }
- if ( ( ! sQuickLinks.equals( "" ) ) )
- {
- out.print("<div id='linksRightTitle'><h3>Quick Links</h3></div>" + sQuickLinks);
- }
- String sRelatedLinks = "";
- try {
- sRelatedLinks = requestItem.getFieldValue( "sRelatedLinks" );
- } catch ( Exception e ) { }
- if ( sRelatedLinks == null ) { sRelatedLinks = ""; }
- if ( ( ! sRelatedLinks.equals( "" ) ) )
- {
- out.print("<div id='linksRightSubSection'><h4>Related Intranet Links</h4>" + sRelatedLinks + "</div>");
- }
- String sInternetLinks = "";
- try {
- sInternetLinks = requestItem.getFieldValue( "sInternetLinks" );
- } catch ( Exception e ) { }
- if ( sInternetLinks == null ) { sInternetLinks = ""; }
- if ( ( ! sInternetLinks.equals( "" ) ) )
- {
- out.print("<div id='linksRightSubSection'><h4>Related Internet Links</h4>" + sInternetLinks + "</div>");
- }
- %>
Expand|Select|Wrap|Line Numbers
- <div id="linksRightSubSection">
- <h4>Page Tools</h4></div>
- <a href="javascript:window.external.AddFavorite('<%= requestItem.getUrl() %>','<%= requestItem.getFullName() %>');" title="Bookmark This Page">Bookmark this page</a>
- <a href="javascript:XXX_printSubSection( 'mainBody' )" alt="Print" title="Print">Print this page
- </a><p>
- <div id="mainBody">
- </div>
- </div>
- <!-- end column 3-->
- <!-- start bottom promotion container -->
- <div id="bottomPromoContainer">
Expand|Select|Wrap|Line Numbers
- <%
- String sBottomPromo1 = "";
- try {
- sBottomPromo1 = requestItem.getFieldValue( "sBottomPromo1" );
- } catch ( Exception e ) { }
- if ( sBottomPromo1 == null ) { sBottomPromo1 = ""; }
- if ( ( ! sBottomPromo1.equals( "" ) ) )
- {
- out.print("<div id='bottomPromo1'><div id='bottomFeatureText'>" + sBottomPromo1 + "</div></div>");
- }
- String sBottomPromo2 = "";
- try {
- sBottomPromo2 = requestItem.getFieldValue( "sBottomPromo2" );
- } catch ( Exception e ) { }
- if ( sBottomPromo2 == null ) { sBottomPromo2 = ""; }
- if ( ( ! sBottomPromo2.equals( "" ) ) )
- {
- out.print("<div id='bottomPromo2'><div id='bottomFeatureText'>" + sBottomPromo2 + "</div></div>");
- }
- String sBottomPromo3 = "";
- try {
- sBottomPromo3 = requestItem.getFieldValue( "sBottomPromo3" );
- } catch ( Exception e ) { }
- if ( sBottomPromo3 == null ) { sBottomPromo3 = ""; }
- if ( ( ! sBottomPromo3.equals( "" ) ) )
- {
- out.print("<div id='bottomPromo3'><div id='bottomFeatureText'>" + sBottomPromo3 + "</div></div>");
- }
- %>
Expand|Select|Wrap|Line Numbers
- </div>
- <!-- end bottom promotion container -->
- </div>
- <!-- End middle content area -->
- </div>
- <!-- end page container -->
My rotating banner code is:
Expand|Select|Wrap|Line Numbers
- String sBanner ="";
- String sBannerURL ="";
- try {
- sBanner = oBoundItem.getFieldValue("sRotatingBanner");
- sBannerURL = oBoundItem.getPath();
- } catch( Exception e ) { }
- out.print("<div id='secondaryFeatureText'>");
- %>
Expand|Select|Wrap|Line Numbers
- <script language="JavaScript">
- var sBanner = "<%=sBanner %>";
- var sBannerURL = "/ourcompany/1375787/";
- var maxAdNo = 7
- var adNo
- var myAd = new Array()
- myAd[0] = sBanner1 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "1.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[1] = sBanner2 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "2.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[2] = sBanner3 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "3.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[3] = sBanner4 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "4.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[4] = sBanner5 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "5.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[5] = sBanner6 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "6.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[6] = sBanner7 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "7.jpg' align='right' class='featurePhotoSecondary' /></a>";
- myAd[7] = sBanner8 = "<a href='" + sBannerURL + "'><img border='0' src='" + sBanner + "8.jpg' align='right' class='featurePhotoSecondary' /></a>";
- adNo = Math.round(Math.random() * maxAdNo)
- document.write(myAd[adNo])
- </script>