Adobe 65007312 Programming Guide - Page 202
Add the title to the HTML template, Testing the plug-in, Adding a customized tagset
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 202 highlights
CHAPTER 11: Web Gallery Plug-ins: A Tutorial Example Adding a customized tagset 202 Add the title to the HTML template The title will be shown on all pages, so it should be part of the boilerplate HTML used at the front of all pages, as defined by the header.html template file. 3. Edit the header.html template file, adding the following heading immediately following the tag: $model.metadata.siteTitle.value Notice that the title text is found in the model variable, the same one bound to the text-input control in the control panel. An event handler here allows edit-in-place in the browser window of the Web Gallery page, in addition to the editing capability provided by UI control. 4. To make edit-in-place work, we need a JavaScript script to handle Live Update. Add the next statement immediately following, identifying a script to be executed 5. We need to make this script part of the plug-in. To do this, we need to both provide the script, and tell the plug-in it's there. Z In the manifest.lrweb page, add this command: AddResources{ source="resources", destination="resources", } Z Create a copy of the file live_update.js, which is part of the Lightroom SDK, and place it in the resources subfolder of the plug-in. This is a sample implementation of the update functions and callbacks needed for Live Update. Testing the plug-in 1. Save all of your changes and restart Lightroom. 2. Select some photos. 3. Go to the Web Gallery page and select the new gallery type. 4. Place the cursor over the "MySample" text that appears as the default title; you should be able to edit it. 5. Look in the Site Info section of the control panel, and try editing the title text from there. Adding a customized tagset A tagset for a web gallery is an external file containing macro-like definitions that can be loaded by your web pages; see "Web SDK tagsets" on page 135. We will create a tagset for this gallery that allows us to build up a complex string. Our tags will build up a complex string by combining random members of a list of predefined elements with some set text and with the content of the tag when it is included in a page.