8 Replies Latest reply on May 20, 2009 3:09 AM by iamjwk

    How to have dynamic thumb folder selection?

    iamjwk

      I am creating a HTML gallery. I want to have a specific folder structure for each album. Now strugling with setting the directory for the thumbnail and photo folder in galleryinfo.lrweb:

       

      The user can enter the albumfoldername, which by default is set on albumName:

      ["nonCSS.albumFolderName"] = "albumName",

       

      Manually this works:

      ["photoSizes.photos.directory"] = "albumName",

       

      But how to get the foldername entered by the user assigned or even the default value above? Tried several options but without luck. Best option would be (I think):

       

      ["photoSizes.photos.directory"] =function() return nonCSS.albumFolderName end,

       

      Does somebody now how to get it working?

       

      Jan-Willem

        • 1. Re: How to have dynamic thumb folder selection?
          SeanMcCormack Adobe Community Professional

          Not sure, but maybe try this instead..

           

          ["photoSizes.photos.directory"] =function() return string.format( "%s", ( nonCSS.albumFolderName) ) end,

          • 2. Re: How to have dynamic thumb folder selection?
            iamjwk Level 1

            Did not work:

             

            It looks like a function is not allowed as in the preview the thumbnail does contain an error message:

             

            bad argument #1 to 'gfind' (string expected, got function)
            Switch View

             

            ...ines\FotoKruse030_html.lrwebengine\FrameContent.html:12: in function 'func'
            ?: in function 'ThumbnailGridFunc'
            ...ines\FotoKruse030_html.lrwebengine\FrameContent.html:42: in main chunk

             

            Played around to see what is possible and what not. Going back fixed parameters the following is accepted:

                 ["photoSizes.photos.directory"] = string.format( "%s", "XXX"),


            But the following experiments did not work:

                     ["photoSizes.photos.directory"] = function() return string.format( "%s", ( nonCSS.albumFolderName) ) end,
                     ["photoSizes.photos.directory"] = function() return string.format( "%s", nonCSS.albumFolderName ) end,
                     ["photoSizes.photos.directory"] = function() return string.format( "%s", [[nonCSS.albumFolderName]] ) end,
                     ["photoSizes.photos.directory"] = function() local pdir = string.format( "%s", "albums/2009/acid stim/photos"); return pdir end,
                     ["photoSizes.photos.directory"] = function() return string.format( "%s", "XXX") end,

                     ["photoSizes.photos.directory"] = string.format( "%s", ['nonCSS.albumFolderName']),
                     ["photoSizes.photos.directory"] = string.format( "%s", nonCSS.albumFolderName),

             

            So got the impression it does not work, unless somebody else has a bright idea or the adobe experts give a insight if this is possible or not.

             

            Jan-Willem

            • 3. Re: How to have dynamic thumb folder selection?
              SeanMcCormack Adobe Community Professional

              Pardon me. I'll refrain from offering suggestions in future. 

              • 4. Re: How to have dynamic thumb folder selection?
                SeanMcCormack Adobe Community Professional

                Just to make it even more weird.. using my original suggestion and putting <%= model.photoSizes.photo.directory %> in the HTML displays whatever name the the nonCSS variable assigns. The images don't get generated though, so even though the string is parsed to photoSizes.photo.directory correctly, it doesn't actually use it. 

                1 person found this helpful
                • 5. Re: How to have dynamic thumb folder selection?
                  iamjwk Level 1

                  Hmm didn't think about that one to test, so you see your suggestions are still required . So we now arrive at a possible bug or something which is not implemented for this one (although that doesn't sound logical)? If you think the same I will give Adobe feedback and hopefully they will solve it in a next update.

                   

                  For time being I am bound to manually copying the folder with large photos and thumbs to a the album folder, as the photo detail and index pages are placed correctly in a subfolder by the following code in manifest.lrweb. It works except from the preview, which gives the message "Working. The content is being generated...cannot demangle /index.html".

                  AddGridPages {
                      destination="albums/" .. model.nonCSS.albumYear .. "/" .. model.nonCSS.albumFolderName, -- combine 4 strings
                      template='FrameContent.html',
                      rows=1,
                      columns=1000,
                  }

                   

                  AddPhotoPages {
                      destination="albums/" .. model.nonCSS.albumYear .. "/" .. model.nonCSS.albumFolderName, -- combine 4 strings
                      template='photo_detail.html',
                  }

                   

                  The subfolder is then like"albums\<year>\<albumfoldername>. Tried also to modify the "photoSizes.photos.directory" in manifest.lrweb, but doesn't work either.

                   

                  Jan-Willem

                  • 6. Re: How to have dynamic thumb folder selection?
                    SeanMcCormack Adobe Community Professional

                    I've already send in a email directly, because I did actually spend 

                    time on this last night, for my own curiosity.

                     

                    Because photoSizes.photos.directory parses the string correctly, I'm 

                    at a loss as to why it doesn't use it.

                    FWIW, I'm accessing the photos in the HTML via $image.metadata.collection.. I just used lavaLamp in case parts of albumFolderName were 

                    actually reserved.

                    1 person found this helpful
                    • 7. Re: How to have dynamic thumb folder selection?
                      arahn Level 1

                      I don't think this can be done for 2.0.

                       

                      Although I don't exactly understand what you're trying to achieve.  Could you explain the workflow to me?

                       

                      - Andy

                      Lightroom Engineer

                      • 8. Re: How to have dynamic thumb folder selection?
                        iamjwk Level 1

                        Andy,

                         

                        What I want, but currently is not possible is to publish albums which are part of a photo gallery. Missing part is possibility to define layout for an index file and defining where the generated images should be stored. Index file will look like:

                         

                        tree.jpg

                         

                        To have a logical structure for maintenance etc. I want to have the following folder structure:

                         

                        \
                        |
                        +- Albums
                             |
                             +- <albumFoldername 1>
                             |        |
                             |        +- photos
                             |        +- thumbnails
                             |        +- resources
                             |        +- stylesheets
                             +- <albumFoldername 2>
                                      |
                                      +- photos
                                      +- thumbnails
                                      +- resources
                                      +- stylesheets

                         

                        May also be possible that first level is the year or a subject based folder. As indicated in previous messages it works to get index.html and the detail photo pages in the folder <albumFoldername>, but not for the images itself (i.e. photos and thumbnails).

                         


                        The workflow would be:
                        1. Select photos/album to export

                         

                        2. Modify the settings in the web plugin (i.e. entering the album name and albumFolderName to use

                         

                        3. Generate the webpage

                         

                        4. Copy the relevant files to my photo website (HTML & ASP pages on my Windows Home Server).

                         

                        5. Manually adjust the index file

                         

                        What I would like to have in Lightroom user interface is:
                        a. a tree like the keywords for defining the photo gallery including sub albums
                        b. select the albums to export
                        c. at same time generate the index file as defined in a lua HTML page

                         

                        But for the time being controlling the destination for the photos would already help.

                         

                        Jan-Willem