5 Replies Latest reply on Sep 12, 2009 11:15 AM by Joe Colson

    [web] how to export gallery as .php instead of html

    foxydancer Level 1

      Hi,

       

      I am going round in circles a bit with this and hoped someone might give me some pointers

       

      - I would like to define the filename of the gallery, just seems to come out as index.html whatever I do

       

      Within manifest, I have tried:

       

      AddGridPages {

       

      filename="whatever.php",

      filetype="php",

      template="grid.html",

      rows=model.nonCSS.numRows,

      columns=model.nonCSS.numCols,

      }

       

        • 1. Re: [web] how to export gallery as .php instead of html
          foxydancer Level 1

          oops....misent....

           

          I have tried various combinations of the above.

           

          I really want to be able to

           

          1) name the file based on the gallery name or user chosen

          2) export as php

           

          I seem to be able to create php files using AddPages but cannot use the <lr:ThumbnailGrid> etc (and cannot name files on the fly)

           

          Is there any way I can use the OS and IO commands in lua to rename files at the end?

           

          Any help much appreciated!

           

          Steve

          • 2. Re: [web] how to export gallery as .php instead of html
            Joe Colson

            Steve,

             

            I had the same question and directed it to one of the Adobe gurus, Andy Rahn.  Here's Andy's response to my question:

             

            Joe

             

            In your manifest, you need an entry like this:

             

            AddPhotoPages {

                   template='detail.html',

                    filetype='php',

                    variant='_large',

                   destination="content",

            }

             

            And don't forget that any page that links to this page needs to have the correct URL, too.  E.g.:

             

            <a href="content /<%= image.exportFilename %>_large.php"

             

            Unfortunately it looks as though anything other than html or htm will not preview corretly in Lr, as the embedded browser doesn't get the correct mime-type.

             

            I got around the browser issue by using "<% if mode == "publish" then %>" in both the grid and detail templates, and in the manifest.  Hope this helps.

             

            Joe

            • 3. Re: [web] how to export gallery as .php instead of html
              foxydancer Level 1

              Many thanks for that Joe!

               

              Not completely clear on your usage of <% if mode == "publish" then %> to help the browser recognise .php extension.....I managed to publish an html and php version of the file - one is good for preview and one for the webserver but your solution sounds a bit cleaner.

              • 4. Re: [web] how to export gallery as .php instead of html
                SeanMcCormack Adobe Community Professional

                <% if mode == "publish" then %>blah <% end %>

                 

                will only only do 'blah' when the gallery is exported or uploaded (or previewed in browser)

                 

                The other mode is 'preview' so you can have something that will preview, and something else that will publish.

                • 5. Re: [web] how to export gallery as .php instead of html
                  Joe Colson Level 1

                  Steve,

                   

                  foxydancer wrote:

                   

                  Many thanks for that Joe!

                   

                  Not completely clear on your usage of <% if mode == "publish" then %> to help the browser recognise .php extension.....I managed to publish an html and php version of the file - one is good for preview and one for the webserver but your solution sounds a bit cleaner.

                   

                  For example, here's how to change an <a> tag in a template to output a php file but still preview an html file:

                   

                  <a href="<%= image.exportFilename %><% if mode == "publish" then %>.php<% else %>.html<% end %>"><img ...... /></a>

                   

                  and for the maifest.lrweb file:

                   

                  if mode == "publish" then
                  AddGridPages {
                      filetype='php',
                      template='grid.html',
                      rows=model.nonCSS.numRows,
                      columns=model.nonCSS.numCols,
                  }
                  else
                  AddGridPages {
                      template='grid.html',
                      rows=model.nonCSS.numRows,
                      columns=model.nonCSS.numCols,
                  }
                  end

                   

                  This should clear up the question concerning the use of <% if mode == "publish" then %> (or <% if mode == "preview" then %>).

                   

                  Joe