Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > template for newsletter

Reply
Thread Tools

template for newsletter

 
 
Mike Brearley
Guest
Posts: n/a
 
      12-20-2004
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


 
Reply With Quote
 
 
 
 
Gérard Leclercq
Guest
Posts: n/a
 
 
Reply With Quote
 
 
 
 
Mike Brearley
Guest
Posts: n/a
 
      12-20-2004
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" <(E-Mail Removed)> wrote in message
news:%4Dxd.5402$(E-Mail Removed)-ops.be...
> http://www.juicystudio.com/tutorial/asp/paging.asp
>



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      12-20-2004
On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <(E-Mail Removed)>
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
 
Reply With Quote
 
Mike Brearley
Guest
Posts: n/a
 
      12-21-2004
"Jeff Cochran" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <(E-Mail Removed)>
> 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


 
Reply With Quote
 
Mike Brearley
Guest
Posts: n/a
 
      12-21-2004
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


 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      12-21-2004
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.


 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      12-22-2004
On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Mike Brearley
Guest
Posts: n/a
 
      12-23-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
> <(E-Mail Removed)> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the template member function of a template in the memberfunction of another template class? Peng Yu C++ 3 10-26-2008 03:51 PM
template template arguments: expected a class template, got `Component<T1, T2, T3> gary.bernstein@gmail.com C++ 1 06-08-2007 07:10 AM
template for newsletter Mike Brearley ASP .Net 9 12-23-2004 02:45 PM
Re: A Newbie Question about template template template tom_usenet C++ 0 07-24-2003 12:06 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM



Advertisments