Home > Support > Resource Center > Web Publisher 4 Documentation > Command Modifiers

     Web Publisher Command Modifiers



Command modifiers allow you to customize the askSam Web Publisher. Following is a list of modifiers and examples of how they can be used.


Command=

Indicates that an askSam command will follow.


Example:

<A HREF="/scripts/as_web4.exe?Command=First&File=filename">First</A>


The Command= can be used with the following modifiers...


First - Takes you to the first document in an askSam file.

URL Example:

<A HREF="/scripts/as_web4.exe?Command=First&File=Filename">First</A>

Header, Footer or Search Result Example:

<A HREF="#FirstDocURL#">First</A>  

With Icon:

<A HREF="#FirstDocURL#"><img src="#FirstIconURL#"> First</A>


Last - Takes you to the last document in an askSam file.

URL Example:

<A HREF="/scripts/as_web4.exe?Command=Last&File=Filename">Last</A>

Header, Footer or Search Result Example:

<A HREF="#LastDocURL#">Last</A>  

With Icon:

<A HREF="#LastDocURL#"><img src="#LastIconURL#"> Last</A>


Prev - Takes you to the previous document in an askSam file.

Header, Footer or Search Result Example:

<A HREF="#PrevDocURL#">Previous</A>

With Icon:

<A HREF="#PrevDocURL#"><img src="#PrevIconURL#"> Previous</A>


Next - Takes you to the next document in an askSam file.

Header, Footer or Search Result Example:

<A HREF="#NextDocURL#">Next</A>

With Icon:

<A HREF="#NextDocURL#"><img src="#NextIconURL#"> Next</A>


Bookmark - Takes you to the given bookmark. Used with the Name command.

URL Example:

<A HREF="/scripts/as_web4.exe?Command=Bookmark&File=Filename&Name=

Bookmarkname#Bookmarkname">Bookmark</A>


DocName - Takes you to the given document name. Used with Name Command.

URL Example:

<A HREF="/scripts/as_web4.exe?Command=DocName&File=Filename&Name=

Document1">Document1</A>


Search - Searches the given askSam file. Used in a form with the Request, NumRows, PickupLines, and PickupDra commands.

URL Example:

<A HREF="/scripts/as_web4.exe?Command=Search&File=filename&Request=

searchterm&ViewName=%28default%29&NumRows=10">Search Term</A>

Header, Footer, Searh Results Example.

<a href="#SearchURL#">Search</a>

Note: Outputs the current search dialog URL. This will output a custom search URL if specified in the Search/Help tab of the WebAdmin utility or the default search dialog if there is no custom search URL defined.

Form Example:

<HTML>

<BODY>


<FORM action=/scripts/as_web4.exe method=Get>

<INPUT Type=hidden Name="Command" value="Search">

<INPUT Type=hidden Name="File" value="DATAFILE.ASK">

<INPUT Type=hidden Name="NumRows" value="10">


Enter your Search:<BR>

<INPUT Size=45 Name="Request">

<INPUT Type="submit" Value="Search"><P>

</FORM>


</BODY>

</HTML>


Note: For more information on search forms see Creating Search Forms in this manual.


SubSearch - Build a search containing various search commands

Form Example:

<HTML>

<BODY>


<FORM action=/scripts/as_web4.exe method=get>

<INPUT type=hidden Name=Command value=SubSearch>

<INPUT type=hidden Name=File value="Contacts.ask">

<INPUT type=hidden Name=Request Value="#req1# AND #req2#" >


Search Term 1: <INPUT size=45 name=req1><BR>

Search Term 2: <INPUT size=45 name=req2>

<INPUT type=submit value=Search>


</BODY>

</HTML>


Note: For more information on search forms see Creating Search Forms in this manual.


SD - Shows the default search page

Example:

<A HREF="/scripts/as_web4.exe?Command=SD&File=Filename">Search Form</A>


Custom Search Results Example:

<A HREF="#SearchURL#">Search</A>


Note: For more information on search forms see Creating Search Forms in this manual.


Help - Takes you to the Web Publisher Help page.

URL Example:

<A HREF="#HelpDocURL#">Help</A>

With Icon:

<A HREF="#HelpDocURL#"><img src="#HelpDocURL#"> Help</A>


Add - Adds data from an HTML form to an askSam file.

Form Example:

<HTML>

<BODY>


<FORM method=POST ACTION="/scripts/as_web4.exe">

<INPUT type=hidden Name="Command" value="Add">

<INPUT type=hidden Name="File" value="c:\ask_base\sera">


Name: <INPUT size=45 name=Name><BR>

Email: <INPUT size=45 name=Email><BR>


<INPUT type=submit value=Submit>

</FORM>


</BODY>

</HTML>


Entry Form - Adds data from an HTML form into an entry form in an askSam file. Used with the Add command.

Form Example:

<HTML>

<BODY>


<FORM method=POST ACTION="/scripts/as_web4.exe">

<INPUT type=hidden Name="Command" value="Add">

<INPUT type=hidden Name="File" value="c:\ask_base\user.ask">

<INPUT type=hidden Name="EntryForm" value="Email Form">


Name: <INPUT size=45 name=Name><BR>

Email: <INPUT size=45 name=Email><BR>


<INPUT type=submit value=Submit>

</FORM>


</BODY>

</HTML>


Button - Shows a standard Web Publisher button (icon). Used with the Name command

URL Example:

<A HREF="/scripts/as_web4.exe?Command=First&File=filename"><IMG Border=0 SRC="/scripts/as_web4.exe?Command=Button&Name=First"> First</A>


Note: Other Button Names include - Doc, Prev, Next, Last, Search, Help


Header, Footer Search Results Example:

<A HREF="/scripts/as_web4.exe?Command=First&File=filename">

<IMG SRC="#FirstIconURL#" BORDER=0>First</A>


Note: Other button names include - #DocIconURL#, #NextIconURL#, #PrevIconURL#, #LastIconURL#, #SearchIconURL#, #HelpIconURL#




Web Publisher Logic Include Statements


The following commands can be used in Custom Header/Footer and Search Results.


#IfValue:Field=Value#

#ElseIfValue:Field=Value#

#EndIfValue:Field=Value#

Use the above commands to select items that are equal to the specified value


#IfValue:Field!=Value#

#ElseIfValue:Field!=Value#

#EndIfValue:Field!=Value#

Use the above commands to select items that are not equal to the specified value


Note: Value can be any numeric or text value that does not include # or =.

Field can be any of the commands listed in this manual that are contained between the # characters. For example: #NextDocURL#, #PrevDocURL#, #IndexMaxHits#, #AllFound#,

#HighlightHits#. Or any HTML form content. For example using this code in the HTML form: <INPUT TYPE="TEXT" NAME="Name" SIZE="45">. You could then use #IfValue:Name=TestName# to test the value in the edit box.


If you would like to modify the Header of your file you can add the following code to the Custom Header box under the Header/Footer tab in the WebAdmin utility. The following code will change the header background color and remove the Help Icon:

<TABLE WIDTH=100% BORDER=0>

<TR>

<TD>


<TABLE WIDTH=100% BORDER=1 CELLPADDING=3 CELLSPACING=0>

<TR><TD BGCOLOR=Silver>

<FONT FACE="Arial" SIZE="-1">


<A HREF="#FirstDocURL#"><IMG BORDER=0 align=middle

SRC="#FirstIconURL#"></A>

<A HREF="#FirstDocURL#">First</A> |


#IfValue:PrevDocURL=0#

<IMG BORDER=0 align=middle SRC="#PrevIconURL#"> Previous

#ElseIfValue:PrevDocURL=0#

<A HREF="#PrevDocURL#"><IMG BORDER=0 align=middle

SRC="#PrevIconURL#"></A>

<A HREF="#PrevDocURL#">Previous</A>

#EndIfValue:PrevDocURL=0# |


#IfValue:NextDocURL=0#

<IMG BORDER=0 align=middle SRC="#NextIconURL#"> Next

#ElseIfValue:NextDocURL=0#

<A HREF="#NextDocURL#"><IMG BORDER=0 align=middle

SRC="#NextIconURL#"></A>

<A HREF="#NextDocURL#">Next</A>

#EndIfValue:NextDocURL=0# |


<A HREF="#LastDocURL#"><IMG BORDER=0 align=middle

SRC="#LastIconURL#"></A>

<A HREF="#LastDocURL#">Last</A> |


<A HREF="#SearchURL#"><IMG BORDER=0 align=middle

SRC="#SearchIconURL#"></A>

<A HREF="#SearchURL#">Search</A> |


</FONT>

</TD></TR>

</TABLE>


</TD>

</TR>

<TR>

<TD>

<BR>


You can modify the Search Results Footer by adding the following code to the End of Results box under the Search Results tab in the WebAdmin utility. The following code will change the footer background color and change the "New Search" link to read "Search Again":


In the Start of Results box type:

<CENTER>

<BR>

<TABLE cellSpacing=0 cellPadding=2 width=90% border=1 BORDERCOLOR="#909090" bgcolor=white>

<TR>

  <TD bgColor=Silver COLSPAN=2>

     <FONT FACE="Arial" SIZE="-1">#IfValue:IndexMaxHits=0#Results#ElseIfValue:IndexMaxHits=0##IndexMaxHits# results#EndIfValue:IndexMaxHits=0# for: #Request#</FONT>

  </TD>

</TR>


<TR>

  <TD bgColor=Silver width="80%">

     #IfValue:AllFound=Yes#

      <FONT FACE="Arial" SIZE="-1">

<A HREF="#NextHitsURL#">New Search</A></FONT>

     #ElseIfValue:AllFound=Yes#

     <FONT FACE="Arial" SIZE="-1">

<A HREF="#NextHitsURL#">Next #NumRows# Hits</A></FONT>

     #EndIfValue:AllFound=Yes#


  </TD>

  <TD bgColor=#f0f0f0 nowrap>

     <FONT FACE="Arial" SIZE="-1">

<A HREF="#SearchURL#">Search</A> |

<A HREF="#HelpURL#">Help</A></FONT>

  </TD>

</TR>


<TR>

  <TD align=center colspan=2>

    <BR>


In the Odd Rows box type:

<DIV ALIGN=LEFT>

 <A class="ResultsLinks"

HREF="#IfValue:HighlightHits=1##HighHitURL##ElseIfValue:HighlightHits=1##HitURL##EndIfValue:HighlightHits=1#"><IMG BORDER=0 SRC="#DocIconURL#"></A><FONT SIZE=3

COLOR="#000000"> #HitNum#.

<A HREF="#IfValue:HighlightHits=1##HighHitURL##ElseIfValue:HighlightHits=1#

#HitURL##EndIfValue:HighlightHits=1#">#Col2#</A><BR>

<UL>

#Col3#<BR>

<FONT SIZE=-1><I>#Col1# hits in document (Document size: #DocSize#

Bytes)</I></FONT>

</UL>

</DIV>


In the End of Results box type:

<BR>

  </TD>

</TR>


<TR>

  <TD bgColor=Silver width="80%">

    #IfValue:AllFound=Yes#

&nbsp;<FONT FACE="Arial" SIZE="-1">

<A HREF="#NextHitsURL#">New Search</A></FONT>

#ElseIfValue:AllFound=Yes#

    #IfValue:NextFile=Yes#

&nbsp;<FONT FACE="Arial" SIZE="-1">

<A HREF="#NextHitsURL#">Next File</A></FONT>

#ElseIfValue:NextFile=Yes#

    &nbsp;<FONT FACE="Arial" SIZE="-1">

<A HREF="#NextHitsURL#">Next #NumRows# Hits</A></FONT>

#EndIfValue:NextFile=Yes#

#EndIfValue:AllFound=Yes#

  </TD>

  <TD bgColor=Silver>

    &nbsp;<FONT FACE="Arial" SIZE="-1">

<A HREF="#SearchURL#">Search</A> |

<A HREF="#HelpURL#">Help</A></FONT>

  </TD>

</TR>


<TR>

  <TD bgColor=Silver COLSPAN=2>

<FONT FACE="Arial" SIZE="-1">Powered by the <A

class="ResultsLinks" HREF=http://www.askSam.com/>askSam

Free Form Database</A></FONT>

  </TD>

</TR>


</TABLE>

<BR>

</CENTER>



#Repeat:ResultsView#

#ResultsViewName#

#EndRepeat:ResultsView#


Everything between Repeat and End Repeat will be repeated for each search results view name in the askSam file. These commands are only used to dynamically list the search results views contained in an askSam file. Use in Search Results header if you want a search box and a search results views drop down box.


Example:

<SELECT id=ViewName name=ViewName>

#Repeat:ResultsView#

<OPTION

#IfValue:ViewName=ResultsViewName#selected#EndIfValue:ViewName=

ResultsViewName#>#ResultsViewName#</OPTION>

#EndRepeat:ResultsView#

</SELECT>





Custom Search Results


The following commands allow you to build a custom search results output. The commands used are:


#HitURL# - Outputs the selected document URL.

#HighHitURL# - Outputs the selected document URL and highlights the search term(s)

#Col1# - Outputs data for a specified column from the askSam search results (col2, col3, etc.)

#HitNum# - Numbers the hit output in the search results  

#DocSize# - Outputs the size of the document in bytes

#NumRows# - Inserts the number of search results to display per page.

#NextHitsURL# - Combination of next 10 hits URL

#DocIconURL# - Outputs the URL to document graphic


Example


1. Open the Web Publisher WebAdmin utility (webadmin4.exe)

2. In the Start of Results box type:

<Table>

3. In the Odd Rows box type:

<tr>

<td>

<a href="#highhiturl#"><img src="#dociconurl#"> #HitNum#.</a></td>

<td>#col1#</td><td>#col2#</td><td>#col3#</td><td>

#DocSize# Bytes</td>

</tr>

4. In the End of Results box type:

</table>

<table>

<tr><td><a href="#Nexthitsurl#">Next #NumRows# Hits</td></tr></table>




Other Web Publisher Include Statements


#IndexMaxHits# -displays the number of hits in a document ( if the askSam file is indexed)

#AllFound# - Used in Search Results with the IF statement. AllFound = Yes if all items in the search have been found.

#HighlightHits# - Used in Search Results with the IF statement. HighlightHits = 1 if the current search results has highlight hits turned on in the web admin.

#NextDocURL# - Used with the IF statement. NextDocURL = 0 if there is not a next document in the file.

#PrevDocURL# - Used with the IF statement. PrevDocURL = 0 if there is not a previous document in the file.

#cgi-bin# - inserts CGI directory on your Web server and the EXE (/scripts/as_web4.exe)

#ForegroundColor#  - inserts value for foreground color (either hex number or word)

#BackgroundColor# - inserts value for background color (either hex number or word)

#BackgroundImage# - inserts URL for background image set using WebAdmin

#File# - inserts the alias or filename

#DefaultPath# - Default path to askSam files -- entered in WebAdmin

#Request# - Outputs the search request in the custom search results

#ViewName# - Outputs the view name used for this result.

#EntirePage# - Outputs the entire document for the hit

#Title# - outputs document title (only works in custom header and footer)

#Author# - outputs document author (only works in custom header and footer)

#Keywords# - outputs document keywords (only works in custom header and footer)

#Comments# - outputs document comments (only works in custom header and footer)



Return to Table of Contents

Quick Downloads

 

How people use askSam

 

Surf Report Newsletter

Subscribe today to receive our FREE monthly newsletter. The Surf Report includes tips, articles, and information about new releases, upgrades, free utilities, and special promotions. Sign up today!


Read Back Issues »
 

"askSam is an essential part of my software tool chest. I can research and collect data from anywhere and any source. Once it is in askSam I can edit, rearrange, organize, and search the information easily. Then I can present it and make it totally useful for other people via the web or CD. Fantastic!"

-- Valda Hilley, Author, Literary Agent, Teaching Consultant, Pack rat, and President, Convergent Press, Ltd.

 

Seaside Software Inc. DBA askSam Systems, 121 S Jefferson Street, Perry FL 32347
Telephone: 800-800-1997 / 850-584-6590   •   Email: info@askSam.com   •   Support: http://www.askSam.com/central.asp
© Copyright 1985-2012   •   Privacy Statement