Announcement

Collapse
No announcement yet.

PDF Files

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

    PDF Files

    We have a large number of .pdf files we want on the server, to be available on various products as extra info for the customer; when clicked on they will open in a popup window.
    There are 450-odd of these files and many of them are 1.5MB.
    Our idea is to load them in to their own directory on the server (not under acatalog) just the once, so that they are separate from the Actinic uploads.
    We can reference them easily enough as a normal text href in the Product Description and this works fine.
    However, we want the pdf filename contained in a variable for each product as it's far easier to maintain.
    When we try and put the filename (with path e.g. /pdf/gpt_07_361_100.pdf) into the variable field on the Product's Properties tab, it gives an error saying the file isn't present and refuses to let us put the filename into the variable.
    Our priority is not to have this large database of files present under actinic as it will slow down uploads, even when the files are there, as it the upload routine still has to go through the checks.

    Can anyone suggest a way round this?

    Cheers
    Kind Regards
    Sean Williams

    Calamander Ltd

    #2
    Have a folder called PDF at the same level as acatalog (upload them manually to this location), then in your design have
    Code:
    http://www.mysite.com/PDF/
    auto included as the start of the URL (you'd have this added if the variable where you fill out the name is not empty) and then you just have the filename in the field. So when you fill in the field with a filename, that link gets auto added and has the filename appended to the end.

    If you try and link to PDF/mypdf.pdf within actinic, it will look for that as a subfolder of your site folder, you need to do a full independent URL.

    Important to run "Xenu Link Sleuth" when you manually maintain links and files.

    Comment


      #3
      Use a Text rather then FileName variable. You'll have to enter the name manually, rather than via Browse. You can always add a bit of PHP to your Product layouts that checks if the file exists and puts a warning on the page if not.

      Or use PDF filenames that are related to your Product ID. Use some PHP in your product layout that checks if such a file exists (keep them all in the same sub-folder of Actinic) and creates the link if found.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Hello Sean,

        I use this for my website, I use this;

        <!-- START Pdf Popout Box -->
        <script type="text/javascript">
        // Popup window code
        function newPopup(url) {
        popupWindow = window.open(
        url,'popUpWindow','height=750,width=750,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
        }
        </script>
        <!-- END Pdf Popout Box -->

        Then in the product description I put

        !!<<a href="JavaScript:newPopup('http://www.mywebsite/acatalog/PDF/myPDF.pdf');">
        <img src="Images\viewpdf.gif" border="0" hspace="20"/></a>>!!

        Then just upload the PDF to the folder "PDF"

        I cant remember where I got that code from now so I cannot take any credit for this

        Comment


          #5
          Hi Guys
          thanks for the tips.
          I used a combination of Norman's changing to a Text property and Lee's making sure the full path was present.
          Works a treat.

          Keith - your code seems rather long-winded for what we need - this is how we did it:
          Code:
          To download PDF fitting instructions !!<<a href="#" onclick="return ShowPopUp('[PDFReference]',900,630)" ><img src="pdf_icon_30.jpg"></a>>!!
          [PDFReference] being the product variable.

          Thanks all
          Kind Regards
          Sean Williams

          Calamander Ltd

          Comment


            #6
            Or put this into your Product layout and automate the job:
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22PDFReference%22%20%2f%3e%20%21%3d%20%22%22" >
            	<br />To download PDF fitting instructions <a href="#" onclick="return ShowPopUp('<actinic:variable name="PDFReference" />',900,630)" ><img src="pdf_icon_30.jpg"></a><br />
            </actinic:block>
            The code will only be inserted on products where PDFReference is not empty.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Hello Sean,

              Yeah it might be long winded but Im gonna be honest I have no idea what Im doing. I am a DIYer.

              It worked so I am happy with it!

              Comment

              Working...
              X