UName10
asked on
2 Pages using the same template displaying incorrectly
My site uses a template applied to different towns and for some reason the asp that's ensuring only certain towns see specific information is messed up.
Here's how the page should look, as it does for Bretwood and here's how it looks bad for Bridgnorth for examaple.
It's this bit that's causing the problem, where I'm using conditions on whether to display certain content; i.e. the Twitter feed only applies to Brntwood:
Something's going wrong though and I really don't know why, so some help would be great.
Here's the rest of the html starting with the #left-nav:
If you need more info or pointers to where the conditions (if statements) are please let me know... Thanks for any replies.
Here's how the page should look, as it does for Bretwood and here's how it looks bad for Bridgnorth for examaple.
It's this bit that's causing the problem, where I'm using conditions on whether to display certain content; i.e. the Twitter feed only applies to Brntwood:
<% if lcase(""&Session("PublicFranchiseName")) <> "brentwood" then %>
<h2 class="in-banner">own<span><%=lcase(Session("PublicFranchiseName"))%></span></h2>
<% else %>
Something's going wrong though and I really don't know why, so some help would be great.
Here's the rest of the html starting with the #left-nav:
<!--Start Main Content-->
<div id="main-content" class="clearfix">
<% If Session("PublicClientGID") = "" then %>
<div id="left-nav" class="xsmall">
<div class="bg quickjump">
<h2><%=Session("PublicFranchiseName")%> Directory</h2>
<%
sqlCommand = "SELECT GID,DirectoryName,DirectoryIcon,LinkDescription,REPLACE(REPLACE(REPLACE(LOWER(RTRIM(DirectoryName)), '&', 'and'), ' ', '-'), ',', '') as URL "&_
" FROM Directories "&_
"WHERE OpenDate < GETDATE() AND "&_
"Approved = 1 "&_
"AND (FranchiseGID IS NULL OR FranchiseGID = '"&Session("PublicFranchiseGID")&"') "&_
"AND (NOT GID = '2d81c28f-95e1-48bd-92ff-b57896b8d516') "&_
"AND ParentDirectoryGID IS NULL ORDER BY DirectoryName;"
getrs cat,sqlCommand,""
while not cat.eof
sqlCommand = "GetAllDirectories '" & Session("PublicFranchiseGID") & "', '" & cat("GID") & "',1"
getrs subcat,sqlCommand,""
catgid = replace(cat("GID"),"{","")
catgid = replace(catgid,"}","")
caturl = cat("URL")
if not subcat.eof then %>
<div class="cat" onclick="if (jQuery('#sub<%=catgid%>').is(':visible')) { jQuery('#sub<%=catgid%>').slideUp('slow'); } else { jQuery('.subcat').slideUp('fast');jQuery('#sub<%=catgid%>').slideDown('slow') };"><%=server.HTMLEncode(cat("DirectoryName"))%></div>
<% if not cat.eof then %>
<div class="quickjump-cat-border"> </div>
<% end if %>
<div class="subcat" id="sub<%=catgid%>">
<% while not subcat.eof
sLink = "/" & lcase(Session("PublicFranchiseName"))
getrs tmp,"USP_Helper_GetDirectoryHierarchy '" & subcat("GID") & "'",""
while not tmp.eof
sLink = sLink & "/" & tmp("URL")
tmp.movenext
wend
tmp.close
set tmp = nothing
sLink = sLink & ".html"
subgid = replace(subcat("GID"),"{","")
subgid = replace(subgid,"}","") %>
<div class="subcat-link"><a href="<%=slink%>">» <%=server.HTMLEncode(subcat("DirectoryName"))%></a></div>
<%
if ""&ucase(getquery("pid")) = ""&subgid then
%>
<script type="text/javascript">jQuery('#sub<%=catgid%>').show();</script>
<%
end if
subcat.movenext
wend %>
</div>
<% end if ' not subcat.eof%>
<% cat.movenext
wend %>
</div>
<div class="border-bottom"></div>
<div class="banners clearfix">
<% if lcase(""&Session("PublicFranchiseName")) <> "brentwood" then %>
<h2 class="in-banner">own<span><%=lcase(Session("PublicFranchiseName"))%></span></h2>
<% else %>
<h3>Car Bodywork Services</h3>
<div class="banner"><% = GetContent("Banner_Left1", Session("PublicFranchiseGID")) %>
</div>
<% end if %>
</div>
<div class="grey-bg clearfix">
<div class="speech clearfix" style="margin-left:-3px;"><div class="left"></div><h3>Brentwood News</h3><div class="right"></div></div>
<% server.execute "/Feeds/News/news-summary.asp" %>
</div>
</div>
<!--End Left Nav-->
<% else %>
<!--Start Left Nav Logged in-->
<div id="left-nav">
<div class="bg">
<h2 class="pink">advertiser</h2>
<div class="list">
<ul>
<li><a href="/AdvertiserAdmin/Home.asp">Advertiser Home</a></li>
<li><a href="/AdvertiserAdmin/EditProfile/">My Profile</a></li>
<li><a href="/AdvertiserAdmin/ManageSubscriptions/">Subscription Adverts</a></li>
<li style="border-bottom:0;padding-bottom:2px;"><a href="/FindMyHome.asp?LogoutClient=1&Site=<% = Session("PublicFranchiseGID") %>">Logout</a></li>
</ul>
</div>
</div>
<div class="border-bottom"></div>
<div class="bg quickjump">
<h2>quick<span>jump</span></h2>
<%
sqlCommand = "SELECT GID,DirectoryName,DirectoryIcon,LinkDescription,REPLACE(REPLACE(REPLACE(LOWER(RTRIM(DirectoryName)), '&', 'and'), ' ', '-'), ',', '') as URL "&_
" FROM Directories "&_
"WHERE OpenDate < GETDATE() AND "&_
"Approved = 1 "&_
"AND (FranchiseGID IS NULL OR FranchiseGID = '"&Session("PublicFranchiseGID")&"') "&_
"AND (NOT GID = '2d81c28f-95e1-48bd-92ff-b57896b8d516') "&_
"AND ParentDirectoryGID IS NULL ORDER BY DirectoryName;"
getrs cat,sqlCommand,""
while not cat.eof
sqlCommand = "GetAllDirectories '" & Session("PublicFranchiseGID") & "', '" & cat("GID") & "',1"
getrs subcat,sqlCommand,""
catgid = replace(cat("GID"),"{","")
catgid = replace(catgid,"}","")
caturl = cat("URL")
if not subcat.eof then %>
<div class="cat" onclick="if (jQuery('#sub<%=catgid%>').is(':visible')) { jQuery('#sub<%=catgid%>').slideUp('slow'); } else { jQuery('.subcat').slideUp('fast');jQuery('#sub<%=catgid%>').slideDown('slow') };"><%=server.HTMLEncode(cat("DirectoryName"))%></div>
<% if not cat.eof then %>
<div class="quickjump-cat-border"> </div>
<% end if %>
<div class="subcat" id="sub<%=catgid%>">
<% while not subcat.eof
sLink = "/" & lcase(Session("PublicFranchiseName"))
getrs tmp,"USP_Helper_GetDirectoryHierarchy '" & subcat("GID") & "'",""
while not tmp.eof
sLink = sLink & "/" & tmp("URL")
tmp.movenext
wend
tmp.close
set tmp = nothing
sLink = sLink & ".html"
subgid = replace(subcat("GID"),"{","")
subgid = replace(subgid,"}","") %>
<div class="subcat-link"><a href="<%=slink%>"><%=server.HTMLEncode(subcat("DirectoryName"))%></a></div>
<%
if ""&ucase(getquery("pid")) = ""&subgid then
%>
<script type="text/javascript">jQuery('#sub<%=catgid%>').show();</script>
<%
end if
subcat.movenext
wend %>
</div>
<% end if ' not subcat.eof%>
<% cat.movenext
wend %>
</div>
<div class="border-bottom"></div>
</div>
<% end if %>
<!--End Left Nav Logged in-->
<!--Start Right Column-->
<div class="right-nav dir">
<div class="banners">
<% if lcase(""&Session("PublicFranchiseName")) <> "brentwood" then %>
<h2 class="in-banner">own<span><%=lcase(Session("PublicFranchiseName"))%></span></h2>
<% else %>
<h3>Hot Cakes Couture</h3>
<div class="banner"><% = GetContent("Banner_Right1", Session("PublicFranchiseGID")) %></div>
</div>
<div class="bg" id="twitter">
<div class="speech clearfix">
<div class="left"></div><h3>Twitter News</h3><div class="right"></div>
</div>
<script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 3,
interval: 6000,
width: 'auto',
height: 300,
theme: {
shell: {
background: 'transparent',
color: '#aaaaaa'
},
tweets: {
background: 'transparent',
color: '#777',
links: '#812668'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: false,
behavior: 'all'
}
}).render().setUser('InsideBrentwood').start();
</script>
</div>
<div class="banners">
<h3>Bespoke Decorating</h3>
<div class="banner"><% = GetContent("Banner_Right2", Session("PublicFranchiseGID")) %></div>
</div>
<% end if %>
<div class="share bg">
<ul>
<li><a class="addthis_button_favorites"><img src="/images/share-fav.png" /></a></li>
<li><a class="addthis_button_twitter"><img src="/images/share-twitter.png" /></a></li>
<li><a href="/<%=lcase(Session("PublicFranchiseName"))%>/business-directory/index.html"><img src="/images/directory-search.png" /></a></li>
</ul>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" defer="true" src="http://s7.addthis.com/js/250/addthis_widget.js#username=insideguides"></script>
</div>
</div>
<!--End Right Nav-->
<div id="middle" class="directory">
If you need more info or pointers to where the conditions (if statements) are please let me know... Thanks for any replies.
<div id="middle" class="directory"> this div has gone inside that right nav div.thats why your are getting messy page.
ASKER
Thanks for your reply, yeah but it's because it's exactly the same code used for each version you saw. It's the asp 'if' statements that are causing the problem.. Wish it was just the div.. You can see where I pointed to the If above.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I fixed it by moving around the if statements in asp.