 |
|
Oracle Tips by Burleson |
Creative
use of Substitution Strings
During development, it is advantageous to add
images to the static files repository when dealing with CSS and
JavaScript. It is also faster for development to add images to the
repository than to be putting them on the file system, especially when
doing remote development work.
The normal use of substitutions strings would be
to reference the HTML DB supplied substitution strings. However, when
adding images to the repository and later moving them to the file
system, this also applies for static files *.js and *.css, it would be
necessary to make changes all over the source code to change #APP_IMAGES#
to #IMAGES_PREFIX#, for example.
To make this process more efficient, a user
defined substitution string can be created as shown in Figure 16.1.
This process was covered in an earlier chapter of this book.
To use the new substitution string, the code would
be modified as shown in the examples below. Notice the change from
using the ## to using the exact substitution notation of & and the
period.
<link rel="stylesheet" href="#APP_IMAGES#.easy_region.css"
type="text/css" />
<link rel="stylesheet" href="&IMAGE_DIR
.easy_region.css" type="text/css" />
It is also possible to create user defined
substitution strings that are custom for the type of file they
reference such as IMAGE_DIR, JAVA_DIR, and CSS_DIR.
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create Dynamic
Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent
Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm |