Frequently Asked Questions

Apr 16, 2024 - 10:45am

 [F] Frequently Asked Questions  / Common Problems and Solutions  / Common Customization Problems & Questions  /

How Can I Get a Web Crossing "Link" to Use the TARGET Attribute?

Rate This FAQ
 (Not yet rated)

Created On: 31 Mar 2000 9:05 am
Last Edited: 26 Sep 2000 10:15 am

Question Printer Friendly

When I use the "Add Link" feature, I would like to specify a TARGET attribute. How?

Answer

Very easily. Modify the addLink and editLink templates to include a settable path variable for your TARGET attribute. Then also modify the folderListItem template for links to check for the presence of this value.

See below for an example of all 3 templates you can cut and paste into your webx.tpl for version 3.0. This code is supplied "as-is" and unsupported.

Version 4.0 includes other enhancements to link functionality and these templates will override that. However the concept is identical...simply modify the templates from version 4.0 of the same names.

Example
<!------------------- addLink ---------------------------->
%% macro addLink %%
<HTML><HEAD>
<!-- Page produced by %% programName %%(r)/%% platform %%-%% version %% (%% programPromo %%) for %% siteLicensee %%-->
<!-- User interface (c)Copyright 1995-2000 by Web Crossing, Inc. All rights reserved.-->
<title>%% siteTitle %% - Add Link</title></HEAD>
<body %% background %%>%% preparedFor %%%% banner %%
<b>%% backPath %%</b>
<ul><h1>%% pathTitle %%</h1></ul>
<FORM name=addLinkForm METHOD=POST ACTION="%% urlBase %%137@%% certificate %%@%% location %%">
You can add a link to a local folder or discussion,
so that a conference item can be accessed by more than one path.
Or you can enter the URL to link to any Web page.
<p>
%% if error %%
	<h3>%% error %%</h3>
%% endif %%
<table>
%% if userIsUnknown && !userCanAddLinks %%
	<!-- Do nothing for guest -- they will be asked to login to post -->
%% else if userIsUnknown %%
	<tr><td colspan=2>%% unknownUserHelp %%</td></tr>%%nop%%
	<tr><td><b>Your name (first then last): </b></td><td><input name=name type=text size=30 maxlength=50 value="%% editName %%"></td></tr>%%nop%%
	<tr><td><b>Your e-mail address: </b></td><td><input name=email type=text size=30 maxlength=100 value="%% editEmail %%"></td></tr>%%nop%%
%% else if userIsGuest %%
	<input name=name type=hidden value="%% userName %%">
	<input name=email type=hidden value="%% userEmail %%">
%% else %%
	<input name=name type=hidden value="%% userName %%">
%% endif %%

<tr><td><b>Title for link: </b></td><td><input type=text name=title size=70 maxlength=250 value="%% editTitle %%"></td></tr>%%nop%%
<tr><td><b>URL to link to: </b></td><td><input type=text name=url size=70 maxlength=250 value="%% editUrl %%"></td></tr>%%nop%%
<tr><td><b>TARGET attribute: </b></td><td><input type=text name=path.target size=35 maxlength=50 value="%% path.target %%"></td></tr>%%nop%%

<tr><td colspan=2>
%% if !siteIsFoldersOnly %%
	(To have the same folder or discussion in this conference referenced from multiple
	places, use the unique ID of the referenced item.  For example, you could enter
	<tt>.f7f4946</tt> where this is the unique ID of some folder or discussion.)
%% else if !siteIsUseShipCon %%
	(To have the same folder referenced from multiple
	places, use the unique ID of the referenced item.  For example, you could enter
	<tt>.f7f4946</tt> where this is the unique ID of some folder or discussion.)
%% else %%
	(To have the same folder or container referenced from multiple	
	places, use the unique ID of the referenced item.  For example, you could enter	
	<tt>.f7f4946</tt> where this is the unique ID of some folder or container.)	
%% endif %%
<p></td></tr>%%nop%%
<tr><td colspan=2><b>In the folder listing, show the link as a: </b>
<br>
<input type=radio name=folderIcon value=web%% if editFolderIcon == "web" %% checked%% endif %%>
Link to a Web page
<br>
<input type=radio name=folderIcon value=folder%% if editFolderIcon == "folder" %% checked%% endif %%>
Link to a folder
%% if !siteIsFoldersOnly %%
	<br>
	<input type=radio name=folderIcon value=discussion%% if editFolderIcon == "discussion" %% checked%% endif %%>
	Link to a discussion
%% endif %%
%% if siteIsUseShipCon %%
	<br>
	<input type=radio name=folderIcon value=container%% if editFolderIcon == "container" %% checked%% endif %%>
	Link to a container
%% endif %%
</td></tr>%%nop%%
<tr><td colspan=2><b>Link description: </b><br>
<textarea name=description rows=10 cols=70 maxlength=24000 wrap=soft>
%% editHeading %%
</textarea></td></tr>%%nop%%
<tr><td colspan=2><b><input type=hidden name=showDescription value=false><input type=checkbox name=showDescription value=true %% if editShowDescription %% checked%% endif %%>
Show description in folder listing</b></td></tr>%%nop%%
</table>
<p>
%% setPath %%
%% if imgButton %%<input type=image name="OK" border=0 align=middle src="%% siteImages %%/ok.gif" %% pictSizeButton %%>%%nop%%
%% else %%<input type=submit name=OK value=OK><input type=submit name=edit value=edit>%% endif %%
<a href="%% urlBase %%14@%% certificate %%@%% location %%"><img alt=" Cancel " border=0 align=middle src="%% siteImages %%/cancel.gif" %% pictSizeButton %%></a>
</form>
%% footer %%</BODY></HTML>
%% endmacro %%

<!------------------- editLink ---------------------------->
%% macro editLink %%
<HTML><HEAD>
<!-- Page produced by %% programName %%(r)/%% platform %%-%% version %% (%% programPromo %%) for %% siteLicensee %%-->
<!-- User interface (c)Copyright 1995-2000 by Web Crossing, Inc. All rights reserved.-->
<title>%% siteTitle %% - Edit Link</title></HEAD>
<body %% background %%>%% preparedFor %%%% banner %%
<b>%% backPath %%</b>
<ul><h1>%% pathTitle %%</h1></ul>
<P>
<FORM name=editLinkForm METHOD=POST ACTION="%% urlBase %%139@%% certificate %%@%% location %%">

%% if error %%
	<h3>%% error %%</h3>
%% endif %%

<table>
<tr><td><b>Title for link: </b></td><td>
<input type=text name=title size=70 maxlength=250 value="%% editTitle %%"></td></tr>%%nop%%
<tr><td><b>URL to link to: </b></td><td>
<input type=text name=url size=70 maxlength=250 value="%% editUrl %%"></td></tr>%%nop%%
<tr><td><b>TARGET attribute: </b></td><td><input type=text name=path.target size=35 maxlength=50 value="%% path.target %%"></td></tr>%%nop%%

%% if !siteIsFoldersOnly %%
	(To have the same folder or discussion in this conference referenced from multiple
	places, use the unique ID of the referenced item.  For example, you could enter
	<tt>.f7f4946</tt> where this is the unique ID of some folder or discussion.)
%% else if !siteIsUseShipCon %%
	(To have the same folder referenced from multiple
	places, use the unique ID of the referenced item.  For example, you could enter
	<tt>.f7f4946</tt> where this is the unique ID of some folder or discussion.)
%% else %%
	(To have the same folder or container referenced from multiple	
	places, use the unique ID of the referenced item.  For example, you could enter	
	<tt>.f7f4946</tt> where this is the unique ID of some folder or container.)	
%% endif %%

%% if userIsHostOrSysop %%
	<tr><td><a href="%% siteHelp %%/syshelp.htm#SortSequence"><b>Sort sequence</b></a>
	in the containing folder:</td><td>
	<input name=sortseq type=text size=10 maxlength=250 value="%% editSortSeq %%"> (higher numbers go to the top)</td></tr>%%nop%%
%% endif %%

<tr><td colspan=2><b>In the folder listing, show the link as a: </b><br>
<br>
<input type=radio name=folderIcon value=web%% if editFolderIcon == "web" %% checked%% endif %%>
Link to a Web page
<br>
<input type=radio name=folderIcon value=folder%% if editFolderIcon == "folder" %% checked%% endif %%>
Link to a folder
%% if !siteIsFoldersOnly %%
	<br>
	<input type=radio name=folderIcon value=discussion%% if editFolderIcon == "discussion" %% checked%% endif %%>
	Link to a discussion
%% endif %%
%% if siteIsUseShipCon %%
	<br>
	<input type=radio name=folderIcon value=container%% if editFolderIcon == "container" %% checked%% endif %%>
	Link to a container
%% endif %%
</td></tr>%%nop%%
<tr><td colspan=2><b>Link description: </b><br>
<textarea name=description rows=10 cols=70 maxlength=24000 wrap=soft>%% linkDescription.toSgml %%
</textarea>
</td></tr>%%nop%%
<tr><td colspan=2><input type=hidden name=showDescription value=false>
<input type=checkbox name=showDescription value=true%% if editShowDescription %% checked%% endif %%>
<b>Show description in folder listing</b></td></tr>%%nop%%
</table><p>
%% setPath %%
%% if imgButton %%<input type=image name=" OK " border=0 align=middle src="%% siteImages %%/ok.gif" %% pictSizeButton %%>%%nop%%
%% else %%<input type=submit value=" OK "> %% endif %%
<a href="%% urlBase %%140@%% certificate %%@%% location %%"><img alt=" Delete " border=0 align=middle src="%% siteImages %%/delete.gif" %% pictSizeButton %%></a>%%nop%%
<a href="%% urlBase %%14@%% certificate %%@%% location %%"><img alt=" Cancel " border=0 align=middle src="%% siteImages %%/cancel.gif" %% pictSizeButton %%></a>%%nop%%
</form>
%% footer %%</BODY></HTML>
%% endmacro %%

<!-- folder item template, default presentation -->
%% macro folderListItem %%
%% if pathIsFolder %%
	<!--                                  Folder -->%%nop%%
	<a href="%% pathUrl %%">%%nop%%
	%% if pathShowsSummaryButton %%
		<img align=bottom border=0 src="%% siteImages%%/t.gif" alt="" %% pictSizeOutline %%>%% nop %%
	%% endif %%
	%% pathIcon border=0 align=bottom%% 
	<b>%%nop%%
	%% pathTitle %%
	</b>%%nop%%
	%% if pathHasItems %%
		 <font size=2>(%%nop%%
		%% if pathHasFolders %%
			%% pathFolderCount %%
			%% if pathHasOneFolder %%
				 folder%%nop%%
			%% else %%
				 folders%%nop%%
			%% endif %%
			%% if pathHasDiscussions %%
				, %%nop%%
			%% endif %%
		%% endif %%
		%% if pathHasDiscussions %%
			%% pathDiscussionCount %%
			%% if pathHasOneDiscussion %%
				 discussion%%nop%%
			%% else %%
				 discussions%%nop%%
			%% endif %%
		%% endif %%
		)</font>%%nop%%
	%% endif %%
	</a>%%nop%%
%% else if pathIsDiscussion %%
	<!--                                 Discusson -->%%nop%%
	%% if pathShowsSummaryButton %%
		<a href="%% urlBase %%230@%% certificate %%@%% location %%">%%nop%%
		<img align=bottom border=0 src="%% siteImages%%/outline.gif" alt="[Outline] "
		%% pictSizeOutline %%>%% pathIcon border=0 align=bottom%% </a>%% nop %%
		<a href="%% pathUrl %%">%%nop%% 
	%% else %%
		<a href="%% urlBase %%230@%% certificate %%@%% location %%">

			%% pathIcon border=0 align=bottom%% 

		<a href="%% pathUrl %%">%%nop%% 
	%% endif %%
	<b>%%nop%%
	%% pathTitle %%
	</b>%%nop%%
	%% if pathHasMessages %%
		 <font size=2>(%%nop%%
		%% pathMessageCount %%
		%% if pathHasOneMessage %%
			 message%%nop%%
		%% else %%
			 messages%%nop%%
		%% endif %%
		%% if pathHasNewMessages %%
			, %%nop%%
			%% pathNewMessageCount %%
			 new%%nop%%
		%% endif %%
		)</font>%%nop%%
	%% else if pathIsNew %%
		 %% if !userIsUnknown %%
		 	<font size=2>(new)</font>
		 %% endif %%
	%% endif %%
	</a>%%nop%%
%% else if pathIsLink %%
	<!--                                 Link -->%%nop%%
	%% setPathFollowLink %%
	%% if pathIsDiscussion && pathShowsSummaryButton %%
		<a href="%% urlBase %%230@%% certificate %%@%% location %%">%%nop%%
		<img align=bottom border=0 src="%% siteImages%%/outline.gif" alt="[Outline] "
		%% pictSizeOutline %%>%% setPath %%%% pathIcon border=0 align=bottom%% </a>%% nop %%
		<a href="%% pathUrl %%">%%nop%% 
	%% else if pathIsDiscussion %%
		<a href="%% urlBase %%230@%% certificate %%@%% location %%">%% setPath %%%% pathIcon border=0 align=bottom%% <a href="%% pathUrl %%">%%nop%% 
	%% else %%
		%% setPath %%<a href="%% pathUrl %%"%% nop %%
		%% if path.target %%target="%% path.target %%"%% endif %%>%%nop%%
		%% if pathShowsSummaryButton %%
			<img align=bottom border=0 src="%% siteImages%%/t.gif" alt="" %% pictSizeOutline %%>%% nop %%
		%% endif %%
		%% pathIcon border=0 align=bottom%% 
	%% endif %%
	<b>%% pathTitle %%</b>%%nop%%
	%% setPathToLink %%
	%% if pathIsFolder && pathHasItems %%
		 <font size=2>(%%nop%%
		%% if pathHasFolders %%
			%% pathFolderCount %%
			%% if pathHasOneFolder %%
				 folder%%nop%%
			%% else %%
				 folders%%nop%%
			%% endif %%
			%% if pathHasDiscussions %%
				, %%nop%%
			%% endif %%
		%% endif %%
		%% if pathHasDiscussions %%
			%% pathDiscussionCount %%
			%% if pathHasOneDiscussion %%
				 discussion%%nop%%
			%% else %%
				 discussions%%nop%%
			%% endif %%
		%% endif %%
		)</font>%%nop%%
	%% else if pathIsDiscussion && pathHasMessages %%
		 <font size=2>(%%nop%%
		%% pathMessageCount %%
		%% if pathHasOneMessage %%
			 message%%nop%%
		%% else %%
			 messages%%nop%%
		%% endif %%
		%% if pathHasNewMessages %%
			, %%nop%%
			%% pathNewMessageCount %%
			 new%%nop%%
		%% endif %%
		)</font>%%nop%%
	%% endif %%
	</a>%% nop %%
	%% setPath %%
	%% if userCanEdit %%
		&#160;<a href="%% urlBase %%138@%% certificate %%@%% location %%"><img border=0 align=top alt="Edit" src="%% siteImages%%/smedit.gif" %% pictSizeInlineButton %%></a>
	%% endif %%
	%% if linkShowDescription && linkDescription %%
		<ul>%% linkDescription.quickEdit.htmlClosure %%</ul>
	%% endif %%
%% else if pathIsChat %%
	<!--                                 Chat room -->%%nop%%
	<a href="%% pathUrl %%">%%nop%%
	%% if pathShowsSummaryButton %%
		<img align=bottom border=0 src="%% siteImages%%/t.gif" alt="" %% pictSizeOutline %%>%% nop %%
	%% endif %%
	%% pathIcon border=0 align=bottom%% 
	<b>%%nop%%
	%% pathTitle %%
	</b></a>%%nop%%
	%% if user.userIsMember( "socks" ) %%
		<a href="%% urlBase %%196@%% certificate %%@%% location %%">[Enter from outside the firewall]</a>%%nop%%
	%% endif %%
	%% if userCanEdit %%
		&#160;<a href="%% urlBase %%193@%% certificate %%@%% location %%"><img border=0 align=top alt="Edit" src="%% siteImages%%/smedit.gif" %% pictSizeInlineButton %%></a>
	%% endif %%
%% else %%
	<!-- Other -->%%nop%%
	<a href="%% pathUrl %%">%%nop%%
	%% if pathShowsSummaryButton %%
		<img align=bottom border=0 src="%% siteImages%%/t.gif" alt="" %% pictSizeOutline %%>%% nop %%
	%% endif %%
	%% pathIcon border=0 align=bottom%% 
	<b>%%nop%%
	%% pathTitle %%
	</b></a>%%nop%%
%% endif %%
<br>
%% endmacro %%