template for newsletter

Discussion in 'ASP General' started by Mike Brearley, Dec 20, 2004.

  1. 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
     
    Mike Brearley, Dec 20, 2004
    #1
    1. Advertising

  2. Gérard Leclercq, Dec 20, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:%4Dxd.5402$-ops.be...
    > http://www.juicystudio.com/tutorial/asp/paging.asp
    >
     
    Mike Brearley, Dec 20, 2004
    #3
  4. Mike Brearley

    Jeff Cochran Guest

    On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <>
    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
     
    Jeff Cochran, Dec 20, 2004
    #4
  5. "Jeff Cochran" <> wrote in message
    news:...
    > On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <>
    > 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
     
    Mike Brearley, Dec 21, 2004
    #5
  6. 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
     
    Mike Brearley, Dec 21, 2004
    #6
  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")
    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.
     
    Dave Anderson, Dec 21, 2004
    #7
  8. Mike Brearley

    Jeff Cochran Guest

    On Mon, 20 Dec 2004 21:26:11 -0500, "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.


    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
     
    Jeff Cochran, Dec 22, 2004
    #8
  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" <> wrote in message
    news:...
    > On Mon, 20 Dec 2004 21:26:11 -0500, "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.

    >
    > 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
     
    Mike Brearley, Dec 23, 2004
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Brearley

    template for newsletter

    Mike Brearley, Dec 20, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    368
    Mike Brearley
    Dec 23, 2004
  2. Chris Theis
    Replies:
    2
    Views:
    487
    Chris Theis
    Jul 24, 2003
  3. tom_usenet
    Replies:
    0
    Views:
    551
    tom_usenet
    Jul 24, 2003
  4. Replies:
    1
    Views:
    2,129
    Gianni Mariani
    Jun 8, 2007
  5. Peng Yu
    Replies:
    3
    Views:
    791
    Thomas J. Gritzan
    Oct 26, 2008
Loading...

Share This Page