Announcement

Collapse
No announcement yet.

Open PDF Files in new window from within a Brochure

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Open PDF Files in new window from within a Brochure

    Hi, I am a novice user of Actinic v8 Business with as you can imagine a very steep learning curve. Getting on ok but cant seem to find a solution to this problem. Is it possible to list a series of PDF documents within a Brochure or Fragment that open up in a new window? I have seethe thread that suggests how to open individual fragment URL’s in new windows, but am not sure that is the ideal solution.

    The Brochure is one containing links to research documents, we have over 250 to list and that grows by some dozen or more a week, some with 50 or 60 pages that also contain links to the full research data. We don’t want our customers to be directed away from our shop to view this research. Having to set up individual fragments for each document seems a long winded way.

    Any help and advice would be great.

    #2
    Welcome Keith.

    See the built-in Help regarding Embedding HTML. You can use this to do what you want.

    You could also keep all these links in a separate file and include it via a user defined Variable.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hi Norman,

      Thanks, i will give the Embedding HTML a go and see what we get. I have looked at the user defined Variable section of both the basic help and the advanced abd to be honest, it mostly went over my head. At this stage i am still trying to learn how to develop a basic understanding of the application but some of what i read leads me to believe that there are very few limitations with Actinic, if you kow what your doing.

      Thanks again, will let you know how i get on.

      Comment


        #4
        You can always edit the lump of HTML in a separate textfile and copy / paste it into the appropriate fragment. That may be easier than managing a huge list within the tiny window available. If you do this it will be easy to later incorporate that file automatically via a user Variable.

        Alternatively if you right-click within a Fragment or Product description, you get an option Zoom that opens a bigger editor window.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi Norman,

          I think i follow, essentially we would have a folder within the actinic directory that contained all the research docs, the HTML code we place in the fragment fetches all the file names and lists them within the body of a single fragment. When a customer clicks on the file name in the fragment, the HTML code will open up a new window and display the file they selected. As we add more files into the folder, more links appear in the fragment to the additional files.

          Just have to figure out how to write the code now then

          Keith

          Comment


            #6
            Originally posted by BigRedKeith
            As we add more files into the folder, more links appear in the fragment to the additional files.

            Just have to figure out how to write the code now then

            Keith
            Not automatically, you do it manually, as you add a file, you add a link etc.

            Comment


              #7
              keith -

              i think you've got the wrong idea here. html will not CREATE the list for you. the html that norman suggests you store is actually the complete list looking something like this:

              <ul>
              <li><a href="documents/pdfdoc01.pdf" target="docs">Name of Doc 1</a>
              <li><a href="documents/pdfdoc02.pdf" target="docs">Name of Doc 2</a>
              .
              .
              .
              </ul>

              this html creates a bulleted list.

              given what you've said in earlier posts, aside from embedding this list into your catalog, it sounds to me as if you need a way to manage the list as well.

              let me give you a quick example

              if you were to create a text file using (say) notepad that had lines that look like this:

              filename:filetitle

              you could easily maintain that and upload new versions of the file to your acatalog directory on your server.

              THEN, in the brochure page (or fragment) you would have one line of html something like this:

              <!--#include file="/cgi-bin/makelist.pl"-->

              what this does is execute a little program that reads the text file and creates the list of urls referencing the documents.

              this requires a small bit of cooperation from your host, and the program is very simple (like 10 lines or so), but i really think this is the best way to solve your problem.
              David Camm
              President
              Advanced Web Systems
              Keller, TX

              Comment


                #8
                HTML, as said above, won't auto generate a list of links from a directory contents.

                However Actinic can help you here as it has the entire PHP (V4) language available to generate code. So you could create a special Fragment Layout - ListOfDocuments - containing
                Code:
                <actinic:block php="true">
                foreach (glob("pdffolder/*.pdf") as $pdffile)
                  {
                  echo '<br /><a href="' . <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e" >'../pdffolder/' . </actinic:block>basename($pdffile) . '" target="_blank">' . basename($pdffile) . '</a>';
                  }
                </actinic:block>
                So assuming you give your PDF's meaningfull names and store them all in sub-folder of your Site folder called pdffolder, you'll end up with

                <br /><a href="DocumentOne.pdf" target="_blank">DocumentOne.pdf</a>
                <br /><a href="DocumentTwo.pdf" target="_blank">DocumentTwo.pdf</a>

                You will need to add the contents of pdffolder into Design / Additional Files so that Actinic uploads them for you.

                To get the above list to appear on a page, just add a new Fragment, give it a Title and set its layout to be ListOfDocuments.
                Last edited by NormanRouxel; 22-Jul-2007, 08:10 AM. Reason: Bugfix. Files need added to Design / Additional Files
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  as always norman, an excellent and insightful solution, however it doesn't do much for meanful document names.

                  as a matter of style, i would open each in the same named window. but that's a nit.....
                  David Camm
                  President
                  Advanced Web Systems
                  Keller, TX

                  Comment


                    #10
                    I just tested the above and it works fine. I agree about the names but it does exactly what Keith asks for in post #5. You can always save the files as e.g. A_very_long_boring_document.pdf.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Hi All,

                      I am very grateful for all the advice, never having undertaken any HTML or coding of any discription before it is a steep learning curve. I think, given the opportunity to do some experimenting, i will get the solution to my problem from what i have here. Just to clarify, all the file names are ideally suited to acting as you suggest Norman as i had previously tried to undertake this project in ePages so had to have_continuous_file_names.

                      Very grateful again and i will update you as soon as i have a result.

                      Keith

                      Comment


                        #12
                        Just go to Design / Library / Layouts / Fragments. Right-click Fragments and choose New Layout. Name it ListOfDocuments. Paste the code (from #8 above) in and OK out.

                        To get the above list to appear on a page, just add a new Fragment, give it a dummy Title and set its layout to be ListOfDocuments.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          Thanks Norman, i see its alot simpler than i thought, knowledge is a wonderfull thing,

                          Keith

                          Comment


                            #14
                            Thanks for the code Norman, it worked a treat, saved me loads of hastle. Only one problem, it works great on the offline preview, but when i upload the site to the Actinic test server it reports none of the files as present on the server.

                            I have added the pdffolder to the Site1 folder, and added all the files to the additional files section, but no joy. Is this something that the test server does not support maybe? is there a way of exploring the CGI bin on the test server to see where the pdffolder actually got uploaded to, i know it should be in the 'acatalog' folder on the server, but i cant seem to get the support team to assist me.

                            Any advice appreciated.
                            Keith

                            Comment


                              #15
                              Add the files to the Additional Files List in Actinic and then upload.

                              Comment

                              Working...
                              X