Forum Moderators: not2easy

Message Too Old, No Replies

Is search.asp with a style.css possible?

Been poking around here awhile... closest i found was

         

youfoundjake

8:23 pm on Jul 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



DrDoc
Moderator This Forum

report msg
joined:Mar 15, 2002
posts:6106
#:1193773 8:05 am on Nov 6, 2003 (utc -8)

Well, you can't use SSI inside a CSS file. So, link to the ASP/PHP file, and make the script output your CSS ;)
Just make sure it outputs it with the correct mime type in the headers: text/css

Or, you can change your server settings, and make all CSS files parsed by the ASP/PHP engine.


taken from [webmasterworld.com...]

I have an index page, index.htm, that is running on IIS 5.1 running. I found an asp search code that when the search box is used on the site, it pulls the results from my catalog/directory, into a file called search.asp. The problem is, the whole site uses a css sheet, and I'd like to have the search results be displayed consistently with the site. But everytime I add the referenceto the style.css, my navigational <divs> expand all the way to the right, probably about 3000px, with the search results being displayed at about 1500px to the right.

Is there a way I can call that css page from my asp page and have it properly parsed or displayed?

How would i change my server settings to make css files parsed by the ASP engine?

Thanks, jake

Marshall

6:14 am on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Jake, I use asp search all the time with css without any problems. One of my site that comes to mind is laid out like:
#*$!#*$!#*$!#*$!XX
#*$!#*$!#*$!#*$!XX
#*$!XXYYYYYYYXX
#*$!XXYYYYYYYXX
#*$!XXYYYYYYYXX
#*$!XXYYYYYYYXX
#*$!XXYYYYYYYXX
#*$!#*$!#*$!#*$!XX
#*$!#*$!#*$!#*$!XX
where the Y is where the search results appear. The X area is the sites basic page design. I know, this is all well and good for me, but my point is have you assigned any CSS values to the search results placing the Y area in its own <div>? This is only a suggestion on my part since I do not know if your search engine displays its results in one of your regular pages or using its own template.

Marshall

[edited by: Marshall at 6:17 am (utc) on July 27, 2007]

youfoundjake

9:08 pm on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Marshall, thanks...
I have a top navigation bar, and a left column navigation bar. The results of the search are displayed in the center, much like yours.

NNNNNNNNNNNNNN
NN SSSSSSSSSSS
NN SSSSSSSSSSS
NN SSSSSSSSSSS
NN SSSSSSSSSSS
NN SSSSSSSSSSS
   SSSSSSSSSSS
  SSSSSSSSSSS
  SSSSSSSSSSS

Where N=Navigation, and S=Search results.

When I add the reference to the .css page in search.asp.
I get

NNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN SSSSSSSSSSSS

I even created a custom .css and set the width to 250px for the side navigation, and the content is aligned Center. and as a result i get:

NNNNNNNNNNNNNNNNNN
NN                  SSSSSSSSSS
NN                  SSSSSSSSSS
NN
NN
NN
NN

I've seen mentions of "#" in various posts in .css, which is read by asp properly? I don't know, heeh.

here is my .css sheet.

/***********************************************/
/* 2col_leftNav.css */
/* Use with template 2col_leftNav.html */
/***********************************************/

/***********************************************/
/* HTML tag styles */
/***********************************************/

body{
font-family: Arial,sans-serif;
color: #333333;
line-height: 1.166;
margin: 0px;
padding: 0px;
}

a:link, a:visited, a:hover {
color: #006699;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
/* overrides decoration from previous rule for hovered links */

h1, h2, h3, h4, h5, h6 {
font-family: Arial,sans-serif;
margin: 0px;
padding: 0px;
}

h1{
font-family: Verdana,Arial,sans-serif;
font-size: 120%;
color: #334d55;
}

h2{
font-size: 114%;
color: #006699;
}

h3{
font-size: 100%;
color: #334d55;
}

h4{
font-size: 100%;
font-weight: normal;
color: #333333;
}

h5{
font-size: 100%;
color: #334d55;
}

ul{
list-style-type: square;
}

ul ul{
list-style-type: disc;
}

ul ul ul{
list-style-type: none;
}

label{
font: bold 100% Arial,sans-serif;
color: #334d55;
}

/***********************************************/
/* Layout Divs */
/***********************************************/

#masthead{
margin: 0;
padding: 10px 0px;
border-bottom: 1px solid #cccccc;
width: 100%;
}

#navBar{
margin: 0 79% 0 0;
padding: 0px;
background-color: #eeeeee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}

#content{
float:right;
width: 75%;
margin: 0;
padding: 0 3% 0 0;
}

/***********************************************/
/*Component Divs */
/***********************************************/

#siteName{
margin: 0px;
padding: 0px 0px 10px 10px;
}

/*************** #pageName styles **************/

#pageName{
padding: 0px 0px 10px 10px;
}

/************* #globalNav styles **************/

#globalNav{
color: #cccccc;
padding: 0px 0px 0px 10px;
white-space: nowrap;
}
/* 'nowrap' prevents links from line-wrapping if there are too many to fit in one line
this will force a horizontal scrollbar if there isn't enough room for all links
remove rule or change value to 'normal' if you want the links to line-wrap */

#globalNav img{
display: block;
}

#globalNav a {
font-size: 90%;
padding: 0px 4px 0px 0px;
}

/************* #breadCrumb styles *************/

#breadCrumb{
font-size: 80%;
padding: 5px 0px 5px 10px;
}

/************** .feature styles ***************/

.feature{
padding: 0px 0px 10px 10px;
font-size: 80%;
}

.feature h3{
padding: 30px 0px 5px 0px;
text-align: center;
}

.feature img{
float: left;
padding: 0px 10px 0px 0px;
margin: 0 5px 5px 0;
}
/* adjust margins to change separation between the feature image and text flowing around it */

/************** .story styles *****************/

.story{
clear: both;
padding: 10px 0px 0px 10px;
font-size: 80%;
}

.story p{
padding: 0px 0px 10px 0px;
}

/************* #siteInfo styles ***************/

#siteInfo{
clear: both;
border: 1px solid #cccccc;
font-size: 75%;
color: #cccccc;
padding: 10px 10px 10px 10px;
margin-top: 0px;

}
/* negative top margin pulls siteinfo up so its top border overlaps (and thus lines up with)
the bottom border of the navBar in cases where they "touch" */

#siteInfo img{
padding: 4px 4px 4px 0px;
vertical-align: middle;
}

/************* #search styles ***************/

#search{
padding: 5px 0px 5px 10px;
border-bottom: 1px solid #cccccc;
font-size: 90%;
}

#search form{
margin: 0px;
padding: 0px;
}

#search label{
display: block;
margin: 0px;
padding: 0px;
}

/*********** #navBar link styles ***********/

#navBar ul a:link, #navBar ul a:visited {display: block;}
#navBar ul {list-style: none; margin: 0; padding: 0;}

/* hack to fix IE/Win's broken rendering of block-level anchors in lists */
#navBar li {border-bottom: 1px solid #EEE;}

/* fix for browsers that don't need the hack */
html>body #navBar li {border-bottom: none;}

/*********** #sectionLinks styles ***********/

#sectionLinks{
position: relative;
margin: 0px;
padding: 0px;
border-bottom: 1px solid #cccccc;
font-size: 90%;
}

#sectionLinks h3{
padding: 10px 0px 2px 10px;
}

#sectionLinks a:link{
padding: 2px 0px 2px 10px;
border-top: 1px solid #cccccc;
width: 100%;
voice-family: "\"}\"";
voice-family:inherit;
width: auto;
}

#sectionLinks a:visited{
border-top: 1px solid #cccccc;
padding: 2px 0px 2px 10px;
}

#sectionLinks a:hover{
border-top: 1px solid #cccccc;
background-color: #dddddd;
padding: 2px 0px 2px 10px;
}

/*********** .relatedLinks styles ***********/

.relatedLinks{
margin: 0px;
padding: 0px 0px 10px 10px;
font-size: 90%;
}

.relatedLinks h3{
padding: 10px 0px 2px 0px;
}

/************** #advert styles **************/

#advert{
padding: 10px 0px 0px 10px;
font-size: 80%;
border-top: 1px solid #cccccc;
}

#advert img{
display: block;
}

/************** #headlines styles **************/

#headlines{
margin: 0px;
padding: 10px 0px 20px 10px;
font-size: 80%;
}

#headlines p{
padding: 5px 0px 5px 0px;
}

[edited by: youfoundjake at 9:14 pm (utc) on July 27, 2007]

youfoundjake

9:10 pm on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



here is the asp page

<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>asdf Search Results</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">

<link rel="stylesheet" href="../../../UsersData/My Documents/insurance/2col_leftNav.css" type="text/css" />
</head>
<!-- All Your Base Are Belong To Us -->
<body>
<table width="1024" border="0">
<tr>
<td><div id="masthead">
<h1 id="siteName">asdf Partners </h1>
<div id="globalNav"> <a href="asdf">asdf.htm</a> ¦ <a href="asdf.htm">asdf</a> ¦ <a href="asdf">asdf.htm</a> ¦ <a href="asdf.htm">asdf</a> ¦ <a href="asdf">asdf asdf </a> ¦ <a href="asdf">asdf.htm</a> ¦ <a href="asdf">asdf asdf </a>
¦&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<script type="text/javascript">
var link = '<a href="mailto:asdf?subject=Update concerning\%20' + document.title + '">Updated:7/20/07<\/a>'; document.write(link);
</script>

</div>
</div>
<!-- end masthead -->
<div id="content">
<div id="breadCrumb"> <a href="index.htm">Home</a> </div><br />

<%
Dim strQuery ' The text of our query
Dim objQuery ' The index server query object
Dim rstResults ' A recordset of results returned from I.S.
Dim objField ' Field object for loop

' Retreive the query from the querystring
strQuery = Request.QueryString("query")

' If the query isn't blank them proceed
If strQuery <> "" Then
' Create our index server object
Set objQuery = Server.CreateObject("IXSSO.Query")

' Set it's properties
With objQuery
.Catalog = "Web" ' Catalog to query
.MaxRecords = 10 ' Max # of records to return
.SortBy = "rank [d]"
.Columns = "filename, path, vpath, size, write, " _
& "characterization, DocTitle, DocAuthor, " _
& "DocKeywords, rank, hitcount"

' Build our Query: Hide admin page and FPSE pages
strQuery = "(" & strQuery & ")" _
& " AND NOT #filename = *admin*" _
& " AND NOT #path *\_vti_*"

' Uncomment to only look for files modified last 5 days
'strQuery = strQuery & " AND @write > -5d"

.Query = strQuery ' Query text
End With

' To set more complex scopes we use the utility object.
' You can call AddScopeToQuery as many times as you need to.
' Shallow includes just files in that folder. Deep includes
' subfolders as well.
'
'Dim objUtility
'Set objUtility = Server.CreateObject("IXSSO.Util")
'objUtility.AddScopeToQuery objQuery, "c:\inetpub\wwwroot\indexserver", "shallow"
'objUtility.AddScopeToQuery objQuery, "c:\inetpub\wwwroot\indexserver\content", "shallow"
'Set objUtility = Nothing

' Get a recordset of our results back from Index Server
Set rstResults = objQuery.CreateRecordset("nonsequential")

' Get rid of our Query object
Set objQuery = Nothing

' Check for no records
If rstResults.EOF Then
Response.Write "Sorry. No results found."
Else
' Print out # of results
Response.Write "<p><strong>"
Response.Write rstResults.RecordCount
Response.Write "</strong> results found:</p>"

' Loop through results
Do While Not rstResults.EOF
' Loop through Fields
' Pretty is as pretty does... good enough:
%>
<p>
<% If rstResults.Fields("doctitle") = "" Then %>
<strong><a href="<%= PathToVpath(rstResults.Fields("path")) %>"><%= PathToVpath(rstResults.Fields("path")) %></a></strong><br />
<% Else %>
<strong><a href="<%= PathToVpath(rstResults.Fields("path")) %>"><%= rstResults.Fields("doctitle") %></a></strong><br />
<% End If %>

</p>
<hr />
<%

' Move to next result
rstResults.MoveNext
Loop

rstResults.MoveFirst
Response.Write "<pre>"
'Response.Write rstResults.GetString()
Response.Write "</pre>"
End If

' Kill our recordset object
Set rstResults = Nothing
End If
%>

</div>
<!--end content -->
<div id="navBar">
<div id="search">
<form action="advanced.asp" method="get">
<input type="text" name="query" />
<input type="submit" value="Search" />
</form>
</div>
<div id="sectionLinks">
<ul>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
<li><a href="asdf">asdf</a></li>
</ul>
</div>
<div class="relatedLinks">
<h3>asdf Setup </h3>
<ul>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
<li><a href="asdf">asdf.htm</a></li>
</ul>
</div>
</div>
<!--end navbar -->

<br /></td>
</tr>
</table>
</body>
</html>

<%
Function PathToVpath(strPath)
Const strWebRoot = "c:\inetpub\wwwroot\"

Dim strTemp

strTemp = strPath

strTemp = Replace(strTemp, strWebRoot, "\")
strTemp = Replace(strTemp, "\", "/")

PathToVpath = strTemp
End Function
%>

[edited by: encyclo at 3:15 pm (utc) on Sep. 3, 2007]
[edit reason] fixed side-scroll [/edit]