|
Viewers > Displaying Uploads |
Top Previous Next |
|
For most content fields you only need a single tag to display their value. Because uploads have more information (url, height, width, etc) they work a little differently.
The Page Viewer Generator will generate a block of code that display uploads. It looks something like this:
<!-- STEP3: Display Uploads --> <?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
... uploads are displayed here ...
<?php endforeach ?> <!-- STEP3: /Display Uploads -->
and inside that block you can display upload fields like this:
<?php echo $upload['urlPath'] ?>
Note: The default "List Viewer" code doesn't include any upload fields. This keeps those pages shorter and easier to work with. If you want to display uploads on the list page, simply copy the code from the "Page Viewer".
Here's a list of upload fields.
All uploads All uploaded files have the following attributes, whether they are images or documents.
Custom Info Fields
To modify the labels for these extra fields, go to Admin > Section Editors, and click "modify" for the upload field. In the "Advanced" section, you'll find the Info Fields.
Image files
Misc. Attributes Note: The following attributes are used by the program, but are included in these docs for the sake of completeness...
num - a unique number that identifies this upload createdTime - the date the upload was added tableName - the table name the upload is associated with fieldName - the field name the upload is associated with recordNum - the record number the upload is associated with preSaveTempId - a temporary id used to identify uploads when creating new records
|