Skip navigation
Aaron Kenney
Currently Being Moderated

Faster method to link to multiple PDFs

Jan 29, 2013 9:59 AM

Tags: #pdf #files #link #linking #faster #quicker

I am using Dreamweaver CS6 on Windows XP. I've got an index that is an HTML document. The document contains a table with several rows of information. Each row has to be linked back to a single PDF. There are hundreds of these PDFs organized in several folders. Is there any faster way to link a file to text than to take the file and drag it to a box or open up a dialog? If I could change the way this index works, I wouldn't need to ask this question. Unfortunately, there are regulatory factors that prevent me from changing the index.

 
Replies
  • Currently Being Moderated
    Jan 29, 2013 10:12 AM   in reply to Aaron Kenney

    If your server supports PHP, you could dynamically populate your index page with the contents from your PDF folders. If your site is static,  you'll need to link each one manually.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 29, 2013 11:19 AM   in reply to Aaron Kenney

    I've never used drag & drop in DW.  I always highlight text or image and use the Link field in the Properties Panel. See screenshot.

     

    CS6Link-properties.jpg

    That said, a PHP script would save you a huge amount of time. 

    For this to work, you must save your index page as index.php and upload to server to test.

     

    <?php
    class SortingIterator implements IteratorAggregate
    {
    private $iterator = null;
    public function __construct(Traversable $iterator, $callback)
    {
    if (!is_callable($callback)) {
    throw new InvalidArgumentException('Given callback is not callable!');
    }
    $array = iterator_to_array($iterator);
    usort($array, $callback);
    $this->iterator = new ArrayIterator($array);
    }
    public function getIterator()
    {
    return $this->iterator;
    }
    }
    ?>
    <p>A LIST OF PDF FILES AS LINKS:</p>
    <!--results-->
    <ul>
    <?php
    function mysort($a, $b)
    {
    return $a->getPathname() > $b->getPathname();
    }
    $it = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('PATH/YOUR_PDF_FOLDER')), 'mysort');
    foreach ($it as $file) {
    echo '<li><a href="' . $file . '">' . $file->getFilename() . '</a> - '. round( $file->getSize() / 1048576, 2) . '  MB </li>';
    }
    ?>
    </ul>

     

    Nancy O.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points