2 Replies Latest reply on Jan 11, 2013 8:14 AM by odoketa

    Getting started with galleries

    odoketa

      Hi all!

       

      I'm new to the Lightroom SDK business, but I'm always willing to devote several weeks to learning how to automate something I could have done manually in half an hour. In this case, I decided I wanted my exported galleries to have a facebook like button and my google analytics tracking code.

       

      I added the code to call things to the header and footer, and added a panel to specify the eventual URL of the live index page, and that all went well. I then modified the large image page to allow you to like a specific image, prepending the URL to the filename so:

       

      div class="fb-like" data-href="$model.metadata.URLforFacebook.value/content/<%= image.exportFilename %>_large.html"

       

      which also worked, sorta. You'll notice I used the image (is object the correct term here? It seems to behave like an object, so I'll use object terminology), but on my main grid.html that doesn't exist. I was able to work around this by creating a second footer file just for the large image page. But then I decided I wanted to have the image description be the description that gets sent to facebook, and things got complicated.

       

      In my head, I should be able to test if an object is instantiated (or exists), and have something like (og meta tags are how facebook gets info)

       

      <% if not exists image.metadata.description then %>

        <meta property="og:title" content="$model.metadata.siteTitle.value" />

      <% else %>

        <meta property="og:title" content="$model.metadata.siteTitle.value" />

        <meta property="og:description" content="$image.metadata.description" />

      <% end %>

       

      Can anyone offer me some guidance on how to do this, or should I just create multiple header and footer files?

       

      Related - what is the dollar sign doing in these, and does 'image' need one? I'm not totally clear on what's happening there (as you can tell, I'm the programmer who knows just enough to need good backups!)

       

      Thanks for any help you can offer!

        • 1. Re: Getting started with galleries
          robertwhite123

          Hi Odoketa.

          Did you ever resolve your problem?

          I am about to try the same sort of thing you've attempted so wondered how far you'd got.

           

          Ive had trouble implementing a unique 'Like' button for every image so far but I'm going through a 3rd party route (AddThis) and it requires the image URL within the header. Not had chance to prove if this is really necessary. Sounds (from your comment) like it might not be.

           

          Can I ask why you are expecting an image object to exist for a page which contains multiple images? (such as the grid page).

           

          I'm working on social buttons in web-templates at the moment so maybe we can compare notes to help each other out?

          Regards

          Rob

          • 2. Re: Getting started with galleries
            odoketa Level 1

            Hi Rob,

             

            I stopped working on this for a while (obviously) but have been thinking I'd like to get back to it. Curious if you (or if any other members) have made progress on this topic. Are there any sites which are better suited to this discussion, or which have a 'getting started with custom templates' area?

             

            David