Large View: Viewer infos

Multiple information can be displayed on an image when opened in large view:

  • Date
  • Tags
  • Filename
  • Custom Label

To display the infos on image viewer, set viewer_infos to true

Value Description
Date Displays the date corresponding to the album's sort option. To learn more about the sort options, click here.
The date format can be changed. For example, date: 'L'
Tags

Displays the tags applied on the image. To see how to tag images, click here.

Filename Displays the filename of the image.
Custom Label This parameter allows the display of a custom label. The value of the custom label should be stored in a Salesforce field on the sObject SharinPixImage__c. The Salesforce field API name should then be used as the value for the parameter custom_label, for example: custom_label: 'CustomFilename__c', where CustomFilename__c refers to the API name of the Salesforce field storing the value for the custom label.

SharinPix Permission

SharinPix Permissions can be used to activate the abilities corresponding to the above mentioned options.

Apex Class & VF Page Implementations

public class ViewerInfos {
    private Map<String, Object> params;

    public ViewerInfos(ApexPages.StandardController stdCtrl) {
        String albumId = (Id)stdCtrl.getId();
        params = new Map<String, Object>{
            'path' => '/pagelayout/' + albumId,
            'abilities' => new Map<String, Object> {
                albumId => New Map<String, Object> {
                    'Access' => new Map<String, Object> {
                        'see' => true,
                        'image_list' => true,
                        'image_upload' => true
                    },
                    'Display' => new Map<String, Object> {
                      'date' => 'L'
                    }
                }
            },
            'viewer_infos' => true
        };
    }

    public String getParameters() {
        return JSON.serialize(params); 
    }
}
<apex:page docType="html-5.0" cache="false"
  showHeader="false"
  sidebar="false"
  standardStylesheets="false"
  standardController="Account"
  extensions="ViewerInfos"
  applyHtmlTag="false"
  applyBodyTag="false">
  <sharinpix:sharinpix parameters="{!parameters}" ></sharinpix:sharinpix>
</apex:page>

0 Comments

Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.