Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-04 17:18:39

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Group articles into a newsletter "issue"

I’m building a newsletter system for a client that behaves like an email digest, with an online equivalet. It will have discreet “issues”, ie. March, 2011. Postmaster will use a template to mail out a collection of articles poured into a pretty html mould, which will contain links back to full articles in a hidden section (not linked to by primary nav) on the site.

This newsletter will consist of:

  • 1 sticky article at the top
  • 5-10 live articles
  • each article will have an associated article image
  • each article will be presented in the newsletter as an excerpt
  • each article will link back to an individual article on the site.

How it should behaive…

  1. /newsletter should show the “latest” issue with a side nav detailed below.
  2. /newsletter/category would display a particular newsletter with the above side nav
  3. /newsletter/article-id would display a full version of a story linked from the excerpt with teh above side nav

The side nav would consist of

  • In This Issue (list of articles in this issue) highlighting the article currently viewed if on an individual article page
  • Past Newsletters (category list of previous issues)

The Problem

I have everything working fine EXCEPT a graceful way for the section landing page to always show the latest issue.

I’m using a category to flag articles for inclusion into a discreet “issue”, eg 2011-March. These will display fine on category pages, and their contents fine on article pages. But how do I tell textpattern that an issue is the “latest” on the landing page?

My test case was using <txp:smd_cal_now offset="15 days" format="%Y-%B"/> to feed the a now value +15 days to the category, but that is timedependant and will expire at some point as time moves on.

I could try finding a live article in the newsletter section with the furthest into the future posted date and putting it’s category in a variable:

<txp:article_custom time="any" section="newsletter" limit="1" >
  <txp:variable name="latest">
    <txp:category />
  </txp:variable>
</txp:article_custom>

Then in my digest’s article calls feed that value back into article_custom tags.

The limitation of that approach is that site editor needs to create categorys named in a specific way, that is, name="2011-March" for sorting and title="March, 2011" for display. And the values aren’t smart, in that they don’t tell TXP about the actual date, unless you feed them back as dates.

Any thoughts, guidance, feedback? Oh come all ye geeks!

Offline

#2 2011-03-04 19:18:46

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: Group articles into a newsletter "issue"

Two quick (half formed) thoughts:
  1. smd_featured Editor would need to ‘unfeature’ articles from previous issue and then ‘feature the new ones. Might cause the landing page to go awry for a minute or two, but you could cover it with rvm_maintenance
  2. adi_variables Get the editor to copy the name of the current category into a variable in the Variables tab (which you could rename to something more meaningful)

Offline

#3 2011-03-04 19:51:23

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 975
Website

Re: Group articles into a newsletter "issue"

off-the-top-of-my-head (always a danger ;-D )

I am guessing you are looking for a plugin-free way, but if you are open to one, could soo_multidoc be bent to your will?

Last edited by maverick (2011-03-04 19:53:00)

Offline

#4 2011-03-04 20:03:59

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Group articles into a newsletter "issue"

pieman > thanks for the suggestions. I ended up using the newest article method, and was able to avoid additional plugins using stock variables and categories.

maverick > That would have been a good solution. I’ll have to dig into that one and see for next time.

So basically, I have everything working as described in the first post.

  • Multipart text/html email sends out nicely.
  • Landing page displays the issue containing the newest live newsletter article
  • Category pages display the appropriate issue selected
  • Individual articles display correctly and the side nav highlights the page you’re on.

About the only thing I’m having a hard time with now is excluding categories in the “Past Newsletters” side nave which don’t have any live articles.

Offline

#5 2011-03-04 20:58:28

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Group articles into a newsletter "issue"

mrdale wrote:

About the only thing I’m having a hard time with now is excluding categories in the “Past Newsletters” side nave which don’t have any live articles.

You could use variable and if_variable, like in this TXP Tip. It’s about sections, but the use for categories is the same.

Offline

#6 2011-03-05 12:49:46

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Group articles into a newsletter "issue"

Paying a return visit from a plugin thread. Looks like you’ve got it mostly worked out, and I’m not sure soo_article_filter would be a help — seems to me the main problems have to do with categories rather articles per se. Multidoc, as maverick suggests, perhaps, although it would work a bit differently than what you’ve come up with.

mrdale wrote:

About the only thing I’m having a hard time with now is excluding categories in the “Past Newsletters” side nave which don’t have any live articles.

Umm, why are there past newsletter categories without live articles? Anyway, the tip linked by Els is a solution.


Code is topiary

Offline

#7 2011-03-05 17:48:30

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Group articles into a newsletter "issue"

jsoo wrote:

Umm, why are there past newsletter categories without live articles? Anyway, the tip linked by Els is a solution.

Good question. Technically the nav should show current (future) AND past newsletters. When a newsletter is sent out it would be considered “past” although it may be full of “future” articles (when you publish a newsletter is is typically for the upcoming month).

But now that I think about it the date component of this whole system is only being used to identify the current issue.

Thanks for your ideas guys. Els > I’ll try that variable-based solution out.

Offline

#8 2014-01-08 16:07:41

simoin
Member
From: Ireland
Registered: 2009-02-10
Posts: 50
Website

Re: Group articles into a newsletter "issue"

Just wondering what the current situation is with this. It sounds like something I am looking for a current project.

Offline

Board footer

Powered by FluxBB