text
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    v BEE Commands
       > Variable Operations
       > Conditional
       > Loop
       > Module Calling
       > Remote Calling
       > Authentication
       > Data Access
       > Socket
       v Special Functions
          o mailto
          o text
          o auth
          o scheme
          o output
          o sleep
          o virtualpage
    > Database Operation
    > Content Management
    > Objects and Classes
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> BEE Commands >> Special Functions >> text <=  =>      <  1  >  
text – specify an online editable and searchable text

BEE Script:   text name [default=string]
[editprompt=string] [init=string]
[webpath=string] [textpath=string]
[display=bool] [showvar=bool]
[edit=bool] [anchor=string]
[highlight=var] [hlbegin=string] [hlend=string];  

 

BEE Tag:     <beetext name [default=string]
[editprompt=string] [init=string]
[webpath=string] [textpath=string]
[display=bool] [showvar=bool]
[edit=bool] [anchor=string]
[highlight=var] [hlbegin=string] [hlend=string]>

 

The Text Command is used to specify a unit of content that can be displayed, searched.  If the "admin" user is logged in, the text can be edited.  In such case, at the end of each text unit there is a link to a Text Edit page, which allows modification of the text content via a word processor-like interface.

The textName is a "Text Variable" in the format of "page&text:item".  The "page" part is default to be the path of the caller page's URL ({sys%urlshown:pathpage}).  For example, If the "text" command is called from "http://www.foo.com/blah/mypage.htm?abc=1", the default "page" part will be "/blah/mypage.htm".)   The "text" part is the name of the text unit and should be unique within the page.  The "item" part is optional.  If used, it helps to group different text units under the same name for clarity.

The value of the text variable is stored with the web site as part of the content.  It can be accessed via the "text" class: "text%page&text:item" (internally implemented as a "scheme" class object).  Since "page" is default to the current page, you can take it that every page has a "text" class of its own (i.e. text%text:item refers to text%CurrentPage&text:item).  The "page&" part is used only if you want to refer to the "text" class of another page.

The "item" part is rarely used.  However, one special item called "AllowView", which will let you specify an access level below which the text is not visible.  For example, if you specify "text%member.htm&sensitive:AllowView" to "member", any sessions with a privilege under that of "member" will not see the text.  (AllowView defaults to "public".)  There are another special item called "AllowEdit" which control the editing of page text.  More details can be found later in this section.

Parameter

default specifies the string to display if the text content is blank.

editprompt specifies the string to display in the text editor if the text content is blank.

init specifies the string to display and save automatically if the text content is blank.  Upon encountering of a "text" command with the "init" parameter, the text content is created and contains the value of the "init" parameter (unlike "default" which does not create any content unless the administrator explicitly click the Edit icon, enter the new text and Save.)

The "init" parameter is usually used to convert an existing page into a template without affecting the appearance.  You just surround the original text with <beetext textName init='originalText'> and after the first run of that page, the content is saved.  (The "init" value has no effect in subsequent runs and therefore can be removed.)

webpath is for "non-standard" text storage structure.  For example, if your web site's home path is http://server/mysite, so for page http://server/mysite/mypage.htm you naturally want its content to be stored under text%/mypage.htm&.  However, according to the "standard" text storage structure, the content should be in text%/mysite/mypage.htm.  To breach the two structures, you can specify webpath=/mysite and the "text" command will work out that the text file is in fact in text%/mypage.htm& (instead of text%/mysite/mypage.htm&).

textpath is for "non-standard" text storage structure.  For example, if for some reasons your want to "bury" your content under a subdirectory (usually for version control), you can specify textpath=/subdir and the "text" command will use text%/subdir/mypage.htm& (instead of text%/mypage.htm&) for the content of http://server/mypage.htm.

display indicates whether to display the text unit or not.  The default is true.  The usual case to turn "display" off is to include a server-side hidden text in the page so that the browser at the client-side cannot see, not even with "View Source".  For example, if a product information page shows pricing that is derived from a cost figure that you set in the page, you would not want the customer to see the cost.  You can use the Text Command with display=false so only the admin login will see it.

showvar indicates whether to evaluate for BEE values before displaying the string.  This does not affect the text in edit, which is always showing the text without evaluation so that the user can modify the expression.  The default is false.

edit indicates whether to allow edit on this text unit or not.  Even when "edit" is true, you still need to login as the "admin" user in order to be able to edit the text unit.  If "edit" is false, the text is not editable in any circumstances.

This parameter can be used to turn off the edit feature for the text unit, or to specify a "duplicated" text unit of which the value will inherit from another editable text unit of the same name.  The default is true.

anchor if specified indicates the name of the HTML anchor tag (e.g. <a name=...></a>) for direct reference/link to the text position.  You can turn anchor off by specifying anchor="".  If the "anchor" parameter is not specified and the "edit" parameter is true, then the system will use the "text" part of the textName as the anchor's name (or if the item part is specified, an underscore followed by the item name will be appended to the anchor's name to make it unique.)

highlight is the name of the variable that contains the string to highlight (usually as a result of a search).  If the variable is an array, every strings in the array will be highlighted.

hlbegin specifies the string displayed before the highlighted text.  The default is "<strong>".

hlend specifies the string displayed after the highlighted text.  The default is "</strong>".

 

There are some special "text" and "scheme" class variables to govern the user privileges of text viewing and editing:

text%page&text:AllowView

The minimum access level required to view the text.  Default is "public".

text%page&AllowView

The minimum access level required to view any text on the page, except for those individually governed by text%page&text:AllowView.  Default is "public".

scheme%AllowView

The minimum access level required to view any text on the website, except for those individually governed by text%page&text:AllowView or text%page&AllowView.  Default is "public".

text%page&text:AllowEdit

The minimum access level required to edit the text.  Default is "admin".

text%page&AllowEdit

The minimum access level required to edit any text on the page, except for those individually governed by text%page&text:AllowEdit.  Default is "admin".

scheme%AllowEdit

The minimum access level required to edit any text on the website, except for those individually governed by text%page&text:AllowEdit or text%page&AllowEdit.  Default is "admin".

 

There are some "scheme" class variables to control the text viewing and editing functions:

scheme%TextEdit:ArgPage

The argument name via which that the "page" part of "name" is passed to the Text Edit page.  The default is "pagecode".

scheme%TextEdit:ArgText

The argument name via which that the "text" part of "name" is passed to the Text Edit page.  The default is "textcode".

scheme%TextEdit:ArgItem

The argument name via which that the "item" part of "name" is passed to the Text Edit page.  The default is "itemcode".

scheme%TextEdit:Link

The HTML code to specify the link to be displayed immediately after the text unit.  You can use BEE Variable syntax within the code.  Some more "local" variables are made available:

param%text:pagecode - The page part of "name"

param%text:textcode - The text part of "name"

param%text:itemcode - The item part of "name"

(If scheme%TextEdit:ArgPage, scheme%TextEdit:ArgText and scheme%TextEdit:ArgItem is specified, use their values in intead of "pagecode", "textcode" and "itemcode" respectively.)

If you are writing your own Text Edit page, all it does is to accept the three arguments, retrieve the text via "text%[text]:[item]", modify it and save it into the same.

If scheme%TextEdit:Link is not specified, the following scheme parameters will be used.

scheme%TextEdit:URL

The URL of the Text Edit page WITHOUT the pagecode, textcode and itemcode arguments.  The default is "/textedit/edit.htm".

scheme%TextEdit:Caption

The caption appear in the Text Edit link.  The default is "Edit".

scheme%TextEdit:Target

The target window that the Text Edit page will appear.  The default is "_blank" (a new window).

scheme%TextEdit:Title

The "title" attribute for the anchor tag. (In IE 4 and above, the title string will appear when you move your mouse over the link.)  The default is "Edit Text".

 

There are some special "session" and "scheme" class variables to govern the image and file insertion:

session%ImageFile

If not blank, it will be used as the image address after the "webpath".  (In this case, the user will not be able to change the image address in the InsertImage dialogue box.)

For example, if the webpath is http://server/mysite and the session%ImageFile is /img/mypict.gif, the image URL will be "http://server/mysite/img/mypict.gif".

session%ImageDir

If not blank, it will be used as the default image directory, and the local file name to upload will be appended to this image directory to form the image address.  The user can overwrite this image directory in the InsertImage dialogue box if they choose to.

The default is "{scheme%ImageDir}" (which in turn defaults to "/images").

scheme%ImageDir

Same as "{session%ImageDir}" but effective only if session%ImageDir is blank.  The default is "/images".

scheme%ImageRoot

The "root" path preceding the image address.  For example, if {scheme%ImageRoot} is "/cust", the image address will be under /cust.  e.g. "/cust/images/mypict.gif".

This setting usually requires the upload directory (sys%croft:filedir) to point to the physical directory corresponding to the "/cust" path.

session%LinkDir

If not blank, it will be used as the default file upload directory, and the local file name to upload will be appended to this link directory to form the link address.  The user can overwrite this link directory in the InsertFile dialogue box if they choose to.

The default is "{scheme%LinkDir}".

scheme%LinkDir

Same as "{session%LinkDir}" but effective only if session%LinkDir is blank.  The default is blank.

scheme%LinkRoot

The "root" path preceding the link address.  For example, if {scheme%LinkRoot} is "/cust", the link address will be under /cust.  e.g. "/cust/mydoc.pdf".

This setting usually requires the upload directory (sys%croft:filedir) to point to the physical directory corresponding to the "/cust" path.

session%Phantom

The "Phantom" mode.  When set, no text will be saved and no images or files will be uploaded.  Instead, the local link will be returned into the Text Edit page for display (so that the user sees the same as if Phantom mode is off).

"Phantom" mode is provided by the Portal Object, not the BEE platform.  But the object requires platform support (via this session variable) to stop text saving or file uploading.

 

After calling the function, the following BEE Variables are made available:

result%text:length

The length of text displayed.  This is usually for checking whether any text has been displayed (e.g. so as to display a default).

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd