ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Setting up Newsletter page...(or, A Bad Case of Brain Freeze)

July 17, 2009 5:40pm

Subscribe [2]
  • #1 / Jul 17, 2009 5:40pm

    benjyrose

    16 posts

    OK, I *know* I should know how to do this…really.  But I can’t for the life of me figure this out, so I humbly bring it to the masses to smack me upside the head with a “duh!” moment.

    A client has begun sending out semi-regular newsletters, with 5 or 6 what-we’ve-been-doing-lately stories in the email…and they want to put those newsletters on their EE-ified website. To build this section, I thought I’d make a weblog called “newsletter”, create a template group called “newsletter”, and make each of the individual stories an Entry. Then, I’d make an “issue” template within the “newsletter” template group, wherein I would aggregate the stories and display them. 

    So far so good. 

    What I can’t get my head around is how I should assign which issue the stories/entries belong to, so that when the Fall 2009 Issue is created, going to http://www.blah.com/newsletter/issue/fall-2009 only grabs those stories that are assigned to Fall 2009.

    I know there’s something painfully obvious here…

    Thanks in advance,
    benjy

  • #2 / Jul 17, 2009 5:50pm

    DRUMZ

    75 posts

    [smack]Categories[/smack]

    Consider yourself smacked 😊

    Create categories for each of the issues. When going to that url, it would pull entries assigned with that category.

  • #3 / Jul 19, 2009 4:23pm

    benjyrose

    16 posts

    Heh….yeah…categories.  Wow, I feel silly.  Thanks, drumz.  Now, do I need to use /category/ in the URL, as in /newsletter/issue/category/summer-2009 (I use “category” as the trigger word elsewhere in the site)?  Or, will /newsletter/issue/summer-2009 do?

  • #4 / Jul 20, 2009 2:40pm

    DRUMZ

    75 posts

    Sorry, didn’t check back all weekend. The first way is correct. You don’t need the word “category”. Your tag on the page that displays the entries for that issue would look like:

    {exp:weblog:entries weblog="issues" dynamic="off" category="{segment_3}"}

    I’ve found for some reason, that I need the dynamic=“off” part in there, even though I thought that by it being dynamic it would take the segment_3 part automatically.


    Also to note, you use the category_id, instead of the category name for the url link.

    So a link for fall-2009 would look like:

    <a href="http://www.blah.com/newsletter/issue/5">LINK</a>

    Where 5 is the category_id of the fall-2009 category. I’m not saying it will be 5, but as an example. I’m sure you get it.


    Hope it helps 😊

  • #5 / Jul 27, 2009 1:19pm

    benjyrose

    16 posts

    OK…so I got that part about using category=”{segment_4}” in the tag to display the entries…thanks for that. Now, I still want to use the category name on the page, as the title. Something like Newsletter: Summer 2009 (where “Summer 2009” is the custom field category_name)

    But if I put an exp:weblog:category_heading tag around that header, like this:

    {exp:weblog:category_heading weblog="newsletter" limit="1" disable="member_data|pagination|trackbacks"}
    <h2>Newsletter: {category_name}</h2>
    <p>{/exp:weblog:category_heading}

    it doesn’t appear (the “Newsletter: ” doesn’t either).  That code DOES work, however, if I use /category/ in the URL.  Can I have the best of both worlds here?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases