publish::handle::image (public)
publish::handle::image item_id [ args... ]
Defined in packages/acs-content-repository/tcl/publish-procs.tcl
The basic image handler. Writes the image blob to the filesystem, then either merges with the template or provides a default <img> tag. Uses the title for alt text if no alt text is specified externally.
- Parameters:
- item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: template::util::get_opts $args # LARS TODO: Added -no_merge, verify how this is supposed to work set html [publish::handle_binary_file $item_id revision_id url error_msg {*}$args -no_merge] # If an error happened, abort if { ![template::util::is_nil error_msg] } { ns_log Warning "publish::handle::image: WARNING: $error_msg" return "" } # Return the HTML if we have any if { ![template::util::is_nil html] } { return $html } # If the merging failed, output a straight <img> tag db_1row i_get_image_info "" # Concatenate all the extra html arguments into a string if { [info exists opts(html)] } { set extra_html [publish::html_args $opts(html)] set have_alt [expr {"alt" in [string tolower $opts(html)]}] } else { set extra_html "" set have_alt 0 } set html "<img src=\"$url\"" if { ![template::util::is_nil width] } { append html " width=\"$width\"" } if { ![template::util::is_nil height] } { append html " height=\"$height\"" } append html " $extra_html" # Append the alt text if needed if { !$have_alt } { append html " alt=\"$image_alt\"" } append html ">" return $htmlGeneric XQL file: <fullquery name="publish::handle::image.i_get_image_info"> <querytext> select im.width, im.height, r.title as image_alt from images im, cr_revisions r where im.image_id = :revision_id and r.revision_id = :revision_id </querytext> </fullquery>packages/acs-content-repository/tcl/publish-procs.xql
PostgreSQL XQL file: packages/acs-content-repository/tcl/publish-procs-postgresql.xql
Oracle XQL file: packages/acs-content-repository/tcl/publish-procs-oracle.xql