{formlabel label=$label|default:"Primary Attachment" for="primary_attachment_id"}
{forminput}
{formhelp note="Enter an existing attachment id to use. Please use the attachment browser to find attachment ids."}
{/forminput}
{formlabel label="Current Attachment" for=""}
{forminput}
{assign var=storage value=$gContent->mStorage[$primary_attachment_id]}
{jspopup href=$storage.source_url title=$storage.title|default:$storage.filename notra=1 img=$storage.thumbnail_url.avatar}
{formhelp note="Click to see large preview"}
{/forminput}
{/if}
{* $no_plugins is set by the including template *}
{if $gBitUser->hasPermission('p_liberty_attach_attachments') and !$no_plugins}
{foreach from=$gLibertySystem->mPlugins item=plugin key=guid}
{if $plugin.is_active eq 'y' and $plugin.primary_edit_field and $plugin.plugin_type eq 'storage'}