|
Frequently Asked Questions v2
|
Topic: Images
0. How to use images in a slice ?
1. How can I include photos to the texts of articles?
2. How can I manipulate images (e.g. create thumbnails)
Using this method, you can, in the "add item" form, use an image from an existing URL or upload an image to use it.
1) in the ActionApps main menu, choose "Slice Admin" option
2) In the list of fields, there will be a field called "Image URL"
3) Edit the properties of the field...
a. Change input type to "File Upload"
b. Edit the parameter to "image/*"
c. Set Validate to "URL"
d. Set Insert to "File"
4) Now, you can use the alias _#IMAGESRC like :
<IMG SRC="_#IMAGESRC">
This can be done thanks to function f_y - expanded string.
- In the slice "Photogallery" make a view or views, which will show a single photograph.
- It is usefull to define the aliases in the Slice Admin / Design / Item Manager, so in the Item Manager you will see below any photograph the alias or aliases for showing it, e.g.: "{view.php3?vid=1047&cmd[1047]=i-1047-6341bce1bd2d5072f75cc440d6e1edf4}"
- In the slice "Articles", for the field "full_text......." create an alias e.g. _#FULLTEXT with fuction "f_y" and with no defined parameters.
- During the editing of items you can just copy the aliases from the slice "photograph" to the places in the text, where you would like to have the photographs
See an example.
In Slice admin interface form for configuring fields there is an input box
for parameters of insert function. For field with insert function "File = uploaded
file",
you can set these parameters:
type of file : maximum image width : maximum
image height : secondary image fields delimited with ## separator
Example:
if you insert parameters:
image/*:450:600:image.....1##image......2
function will do these actions after submitting the item/article:
- check whether the file to be uploaded has proper type (image) and upload
only such files (this works for any file upload fields, for example you can
specify limit to application/msword or application/*)
- check if picture is bigger than maximum dimensions set in field parameters.
If yes, image will be resampled to maximum dimension (aspect ratio maintained).
- if there are set any "other fields" (in this example
"image.......1" and "image.......2"), function will also
fill-in these fields with url to the same picture. If there are maximum
dimensions set in parameters of these field(s), function will resize
image accordingly.
Limits of the function:
- image functions work only if there is GD library installed (GD is standard part of PHP since PHP version 4.3.0)
- Image resampling functions work only with GD supported types (JPG, PNG, WBMP - not GIF - GIF will be supported since July 7th, 2004, when LZW patent expires world-wide)
- secondary image fields must be in the input form after source field
- filling of secondary image fields is not recursive (secondary image fields
can not be defined in a chain)
- there is no error reporting
This FAQ interface was developed
by Jason at Commons.ca
|
APC
ActionApps is a free software content management system initiated by
the Association for Progressive Communications (APC)
APC - Internet and ICTs for social justice and development |