How to add a PDF file to a Joomla article

tiny-mce-pdf-file-illA common task many web site owners do regularly, is to add PDF files or other documents to their articles.

In this post, you will learn how to add a link to a PDF or any other document file to a Joomla article.

This time around, I will explain how you can do this using a basic Joomla installation. Later this week, I will show you how to insert a PDF file into a Joomla article using the JCE File Manager plug-in.

This is how you insert a PDF file using the Joomla core. For this tutorial, I have used Joomla 1.7.

I will assume that you are using a standard installation of Joomla and that you are using the default text editor TinyMCE. If you're using JCE, you can follow most of the procedure even if some of the screens may look a bit different.

1. First, you need to upload the PDF file (or other type of document file) to a folder in the Joomla Media Manager. In Joomla 1.6 and later versions, the Media Manager is found in the Joomla administrator -> Content menu -> Media Manager. In Joomla 1.5 it is found in the Joomla administrator -> Site menu -> Media Manager.

You will need to create a folder to contain your PDFs if you don't already have one. I think this is better than putting the files in the root folder (which is /images/ or similar). You can create the folder in the Media Manager window. On the left side of the window you will see the folders in your images root folder, on the right side are the files in those folders, and below are the create folder and upload functions.

folders-media-manager

When you have navigated to your folder, you can upload the file using the "Start Upload" button (click the "Browse" button to select your files.

upload-file-manager

2. When the file has uploaded, the Media Manager will alert you like this:

joomla-media-manager-upload-complete

You will see your uploaded file in the right hand side of the Media Manager:

joomla-media-manager-pdf-file

2. Now, you need to find the exact URL for your uploaded file. Even though the folder structure on the left hand side says "Media" for the root folder (top level), the actual folder the files are in can be named differently. Actually, in Joomla 1.6 and later it is called "images" and resides in the Joomla root folder. So the path to the folder is:

http://yourdomain.com/images/

In fact, you will see parts of the URL in the text field below the file window. This is the full server URL, though. So it can be a bit confusing. Nevertheless, the portion (on my server) behind the /www/ is the on I'm after. On your server it might be /public_html/ or something else.

When you want to find the exact path to the image, you need to construct it from the URL to your site, the images folder, your sub folder + the file name. In my case, the file URL will be:

http://yourdomain.com/images/pdf/twitter-report.pdf

Obvious, right? Didn't think so... Actually, I recommend you always test the file URL in your browser before using it further.

When you have verified the URL, copy it to your clipboard or into a text document for later use. You will need it in a minute.

3. Create an article in Joomla in which to place the link.

joomla-add-new-article

Add a title to the article and save:

article-manager-pdf-file

4. You should create a text like "The PDF file" or whatever you would like as your link text.

Select the text and click the link icon in TinyMCE (the standard text editor in Joomla).

5. Now, paste in the link you created earlier (to your PDF file). Click "Insert".

joomla-insert-link

Finally, the link to the PDF file has been inserted into the article and you can save the article as you normally would.

joomla-final-pdf-link

Now, all you have to do is to create a menu item linking to the article and you're all set.

You can also check out the tutorial on how to add a PDF file using the JCE File Manager. Stay tuned!

Kristoffer Sandven, JoomlaBlogger

Kristoffer Sandven is a Joomla! and SEO consultant living in Horten, Norway. He's the founder and author of JoomlaBlogger.

Website: www.joomlablogger.net/about
Read 51445 times Last modified on Tuesday, 14 February 2012 11:32

Want more information like this?

Buy the 287 page e-book Blogging with Joomla - only $9!

  • Understand and configure Joomla extensions like K2 and EasyBlog
  • Optimize your web site for search engine visibility
  • Create and organize content
  • Track and analyze traffic
  • Integrate advertising, social functions and video
  • Optimizing a web site for speed and much more 
  • Great info for anyone with a Joomla website
buy
comments powered by Disqus
Powered by Joomla
Download Joomla for free