473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

template for newsletter

I need to create a template for an online newsletter that will auto-generate
page number (with current page not hyperlinked) and previous and next
buttons (no previous on first page and no next on last page).

Does anyone know of any quick asp code that will do this? I don't think
that it'd be too hard to do, but I'm very new at asp.

Basically at the top of the page, I'll have a back and next button and on
the bottom of the page I'll have the word it set up sort of like this:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Contents
Next

I have a template setup in dreamweaver that has edit zones for all of those
now, but I'd like to just have one edit zone, the main content of the page,
and have the rest auto-generated from asp code so that if the page design
needs to be changed at all... it's easy to just change the template and
have it applied to all the pages.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley
Nov 19 '05 #1
9 1219
Is there a way to do it without a database? The content includes images and
special formatting so it appears as it did in the original print.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley

"Gérard Leclercq" <ge*************@pas-de-mail.fr> wrote in message
news:%4*******************@phobos.telenet-ops.be...
http://www.juicystudio.com/tutorial/asp/paging.asp

Nov 19 '05 #3
On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <no****@spam.com>
wrote:
Is there a way to do it without a database? The content includes images and
special formatting so it appears as it did in the original print.


How do you know where the page breaks are? Okay, now that *you* know,
how are you going to explain that to the computer...? :)

You can likely accomplish your task with the proper use of
stylesheets, try a CSS group or DHTL/HTML group for details.

Jeff
Nov 19 '05 #4
"Jeff Cochran" <je*********@zina.com> wrote in message
news:41****************@msnews.microsoft.com...
On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <no****@spam.com>
wrote:
Is there a way to do it without a database? The content includes images
and
special formatting so it appears as it did in the original print.


How do you know where the page breaks are? Okay, now that *you* know,
how are you going to explain that to the computer...? :)

You can likely accomplish your task with the proper use of
stylesheets, try a CSS group or DHTL/HTML group for details.

Jeff


Page breaks are irrelivent... This isn't a typical enter text into database
and get a newspage from it. It's something that needs to be layed out
exactly as it is on paper. We're creating each page, but want the outer
areas (navigation, background, etc...) to be controlled by a template. No
database files....

Maybe I need to find a dreamweaver group as we're using dreamweaver
templates for this...

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley
Nov 19 '05 #5
I need to know how do I (in asp) I have it see how many pages named exactly
as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
bottom that has:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | Contents Next

The page your on won't be hyperlinked, but the rest are and the last page
doesn't have the next button.

This isn't for a newsletter where the text in entered in a database. We'll
actually be coding the context in each page, but I want all the rest to be
controlled by a template so it's easier for us down the road if we decide to
change the layout and so that we can just slap the content in without
worrying about the navigation.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley
Nov 19 '05 #6
Are you manually splitting the pages? If so, you can do this with script, if
each page contains some identifier of this. In asp.net you have a form with
the runat="server" attribute. You could put in this two hidden inputs. Then,
so these are picked up by your asp.net script, you also give them
runat="server" attributes and an appropriate id (eg. "page_no" and
"total_pages"). Then the templates can also contain server script which look
for these two attributes.

HTH,
ME

--
Martin Eyles
ma**********@NOSPAM.bytronic.com

"Mike Brearley" <mi*****************@DONTDOIT.hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
I need to know how do I (in asp) I have it see how many pages named exactly as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
bottom that has:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | Contents Next

The page your on won't be hyperlinked, but the rest are and the last page
doesn't have the next button.

This isn't for a newsletter where the text in entered in a database. We'll actually be coding the context in each page, but I want all the rest to be
controlled by a template so it's easier for us down the road if we decide to change the layout and so that we can just slap the content in without
worrying about the navigation.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley

Nov 19 '05 #7
Mike Brearley wrote:
I need to know how do I (in asp) I have it see how many pages named
exactly as page1.asp, page2.asp, etc.... exist and put a bottom nav
bar on the bottom that has:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | Contents Next

The page your on won't be hyperlinked, but the rest are and the last
page doesn't have the next button.

This isn't for a newsletter where the text in entered in a database.
We'll actually be coding the context in each page, but I want all the
rest to be controlled by a template so it's easier for us down the
road if we decide to change the layout and so that we can just slap
the content in without worrying about the navigation.


I'm not sure this buys you a whole lot, since you are working with a fixed
set of script names, but...

....you can construct an include (or executable script) that examines an
array of script names against the current script. For example, you could
create a document like this -- let's call it paging.js.asp:

<%@ Language=JScript %><%
var links = new Array("default.asp","page1.asp","page2.asp", ...),
script = Request.ServerVariables("SCRIPT_NAME"),
r = previous = next = null,
a = new Array()

for (var i=0; i<links.length; i++) {
r = new RegExp(links[i],"i")
if (r.test(script)) {
a.push(i+1)
if (i>0) previous = links[i-1]
if (i<links.length-1) next = links[i+1]
} else {
a.push("<a href=\"" + links[i] + "\">" + (i+1) + "</a>")
}
}

if (previous)
Response.Write("<a href=\"" + previous + "\">Previous</a> ")
Response.Write(a.join(" | "))
if (next) Response.Write(" <a href=\"" + next + "\">Next</a>")
%>

Then you can insert the numbering scheme anywhere in your document with:

<% Server.Execute("paging.js.asp") %>

Note that it makes no difference what ASP language you use in the calling
script.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Nov 19 '05 #8
On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
<mi*****************@DONTDOIT.hotmail.com> wrote:
I need to know how do I (in asp) I have it see how many pages named exactly
as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
bottom that has:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | Contents Next

The page your on won't be hyperlinked, but the rest are and the last page
doesn't have the next button.

This isn't for a newsletter where the text in entered in a database. We'll
actually be coding the context in each page, but I want all the rest to be
controlled by a template so it's easier for us down the road if we decide to
change the layout and so that we can just slap the content in without
worrying about the navigation.


This is better done client-side in a Javascript navigation script, but
you could script it server side if needed. A quick Google showed this
example:

http://www.aspin.com/func/content?tr...ten&id=5412810

Jeff
Nov 19 '05 #9
Javascript navigation script works for me... any good examples out there?

Also, please note, I'm breaking the pages apart myself (no database), I just
need the navigation script for a template object so that I don't have to
code it (granted just copy/paste) everytime I create a page.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley

"Jeff Cochran" <je*********@zina.com> wrote in message
news:41****************@msnews.microsoft.com...
On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
<mi*****************@DONTDOIT.hotmail.com> wrote:
I need to know how do I (in asp) I have it see how many pages named
exactly
as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
bottom that has:

Previous page 1 | 2 | 3 | 4 | 5 | 6 | Contents Next

The page your on won't be hyperlinked, but the rest are and the last page
doesn't have the next button.

This isn't for a newsletter where the text in entered in a database.
We'll
actually be coding the context in each page, but I want all the rest to be
controlled by a template so it's easier for us down the road if we decide
to
change the layout and so that we can just slap the content in without
worrying about the navigation.


This is better done client-side in a Javascript navigation script, but
you could script it server side if needed. A quick Google showed this
example:

http://www.aspin.com/func/content?tr...ten&id=5412810

Jeff

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cooldv | last post by:
i have an *access database + ASP newsletter* that is working fine and it sends newsletter to ALL the email addresses in the DB. i want to send this newsletter to only a select group (like people...
9
by: Mike Brearley | last post by:
I need to create a template for an online newsletter that will auto-generate page number (with current page not hyperlinked) and previous and next buttons (no previous on first page and no next on...
3
by: Mike Copeland | last post by:
I am contemplating the creation of a personal family "newsletter" Web site - one that will be ordered by yearly events within my family. To save myself a lot of trial and error, I wonder if there...
1
by: matz2k | last post by:
I've got a big problem with the CSS layout which I've produced with Photoshop/Dreamweaver especially for my ebay auctions. This is what it looks like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.