Add a new Field Definition to the News Module of type "Text Input"
Create an UDT named "JMFP" with the following code:
Code: Select all
if($jmfp = cmsms()->GetModuleInstance('JMFilePicker'))
{
echo $jmfp->CreateFilePickerInput( $jmfp, $params['id'],$params['name'], $params['value'], $params, $params['returnid'] );
}
Edit /module_custom/News/templates/editarticle.tpl and replace line 184 with the following code:
Code: Select all
{if $field->prompt == 'FIELDNAME'}
{JMFP name=$field->nameattr value=$field->value dir='YOURDIR' }
{if !empty($field->value)} {$delete_field_val} <input type="checkbox" name="{$field->delete}" value="delete" />{/if}
{elseif $field->type == 'textbox'}
Replace the FIELDNAME with the name of the Field Definition you created above.
Replace the YOURDIR with the directory you want to list/start at relative the /uploads/
In your detail template (you will have to adjust for the summary template) replace lines 115-117
Code: Select all
{else}
{$field->name}: {$field->value}
{/if}
Code: Select all
{elseif $field->name == 'FIELDNAME'}
<img src="{uploads_url}/YOURDIR/{$field->value}"/>
{else}
{$field->name}: {$field->value}
{/if}