Print-Ready Version

A question that I am asked quite often by other developers creating dynamic news/article content is, "How do sites like CNET and others achive the 'Print Version' that gets rid of images, banners, etc." The process is actually very simple, and uses a server behavior that comes standard with Dreamweaver UD/MX.
CCM - Tutorial Print-Ready Version
(Page Two)

STEP ONE: Creating The DB and Display Page
OK, our first goal is to create the database where our article data will be stored. I have attached a simple version of the required DB below if you don't have much experience in Access, but it shouldn't be difficult.

(Remember, this tutorial creates the display page and the 'print-ready' page, NOT the 'News Creation' page. Use this to add functionality to your existing news pages.)



DB SETUP
1.) Open Access and create a new DB calling it CCMDB.mdb. Create a table titled Tut_PrintVersion and create the following columns with the same titles as shown in the image below:

EXAMPLE:
Make sure that your Field Names are the same as shown to avoid confusion for this tutorial.

ITEM_TITLE: This field will be used to store the title of the article.
ITEM_DATE: This field will be used to store the article date.
ITEM_AUTHOR: This field will be used to store the article author.
ITEM_SUMMARY: This field will be used to store a short article summary for the display page.
ITEM_CONTENT: This field will be used to store the full article content.
DOWNLOAD SAMPLE ACCESS 2000 DB


2.) Now setup your DSN connection in DWMX so that we can utilize the DB contents going forward - title your DSN CCMDB and your MX Connection connCCMDB.

If you are unfamiliar with this process check out these links:
Setting Up A DSN In Windows
Connecting to a Database




CREATING THE ARTICLE DISPLAY PAGE

Next, we are going to create a page with a very simple article display with a repeat region, as well as the print icon linking to the 'print-ready' page.

1.) Create a new ASP page and title it print_display.asp, and another blank page called print_detail.asp which will be our detail page.
2.) In the
print_display.asp page, create a recordset called 'rsEventListing' to grab our data from the DB.

• In the 'Application' tab on the right hand side select 'Bindings'.
• Press the (+) sign and then select 'Recordset (Query)'
• Fill in the following information shown below, then press 'Test' to make sure we get our data.


• Once you are sure everything is right, press 'OK'.


3.) We have our recordset pulling the correct records, so now we need to add our dynamic text to the page itself.

• Create a table with the following specifications by selecting 'Insert' > 'Table'


4.) In that table, add the following dynamic text areas:

• Select 'Insert' > 'Application Objects' > 'Dynamic Text'
• Press the 'Item_Title' field (as shown below) and then press 'OK'


• Do this for each field until your table looks like below.



4.) If you test your page in IE, it should pull in your first record and look like this.



NEXT PAGE - STEP TWO: Adding Repeat Region & Print Icon

Jeremy Conn

Jeremy ConnJeremy Conn has been involved in web development and graphic design since 1995. Interested in art & music all his life, Jeremy was drawn into web design after being given a copy of the original Dreamweaver product. Since that time, Jeremy has started Conn Creative Media, a design agency that he runs with his beautiful wife, Andrea, from Portland, Oregon. "I learned much of what I know about DW development from sites like DMXZone, so I feel strongly about giving back and doing my part to keep this amazing community running. Much thanks to George Petrov and the whole DMXZone team." - Jeremy

See All Postings From Jeremy Conn >>

Comments

Great, but w/o a DB?

August 8, 2003 by Melchiah JoNois

This is a great tip/technique.  However, how does one go about doing the same thing with a webpage that is not database driven?  I have a simple .html page that has a graphical header and side panels with text in the center.  I want an icon that loads a print-ready version of that page (no graphics, etc...), but my site is not database driven.  How do I accomplish that?

 

Melchiah

You must me logged in to write a comment.