template for newsletter

M

Mike Brearley

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
 
M

Mike Brearley

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
 
J

Jeff Cochran

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
 
M

Mike Brearley

Jeff Cochran said:
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
 
M

Mike Brearley

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
 
M

Martin Eyles

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
 
D

Dave Anderson

Mike said:
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")
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+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.
 
J

Jeff Cochran

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?tree=aspin/tutorial/websiten&id=5412810

Jeff
 
M

Mike Brearley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top