Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-03-04 13:55:41

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Magazine Issues

BUT What i want to know is how to get it to show the issue number, so in my header I could have ‘Issue 1 – March 2009’

Use a custom field (issue_no) with each article. Then in your header, show upm_datetime on the main index, otherwise show the cf.

Offline

#14 2009-03-04 13:59:49

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

Yeah but I need the issue number to relate to the month! If it was a custom field I would have to manually choose the issue number, and other authors could type in incorrect numbers etc, and they would be shown by month but with incorrect issue numbers. I need something automatic whereby the month and issue number are tightly integrated!


~ Cameron

Offline

#15 2009-03-04 14:02:35

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: Magazine Issues

I have the default page setup and using that plugin upm_datetime it only shows the articles from the current month, so showing this months issue!

That’s what you asked for above:

and on the home page it is able to automatically change the issue based on the month. so say i add 20 articles in march, they would all show, and then as soon as we hit april, they will all disappear and show the april issues instead!

Issue 1 – March 2009

I’m not sure about how you’d make issue 1 match March – maybe something with rvm_counter or using txp:variable and bumping the number each month – but if you issue matches the month number it’s easy. As I indicated above ;-) you’d write Issue <txp:posted format="%m" /> – <txp:posted format="%B %Y" /> (all of this is in the textbook) and for your default page Issue <txp:upm_date format="%m" /> – < txp:upm_date format format="%B %Y" />

Last edited by jakob (2009-03-04 14:04:58)


TXP Builders – finely-crafted code, design and txp

Offline

#16 2009-03-04 14:06:27

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

If I made the issue number match the month, I could only have 12 issues, so say I get an issue in Jan 2011, it might be issue 22, so it needs be a unique number for that month of that year, hence why it can’t be a number corresponding to the month!


~ Cameron

Offline

#17 2009-03-04 14:08:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: Magazine Issues

If your issue number absolutely has to be different to the month, you could also try using fha_time_diff to output the months since your start issue (note I’ve never used the plugin so you’ll need to work out how yourself).


TXP Builders – finely-crafted code, design and txp

Offline

#18 2009-03-04 14:38:22

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

Okies I have a good luck at the help document, and have so far come up with this:

<h1>Issue #<txp:fha_time_diff month="<txp:upm_datetime format="%m" />" year="<txp:upm_datetime format="%Y" />" /> - <txp:upm_datetime format="%B %y" /></h1>

It doesn’t return a value though, has anyone got some experience with this plugin?
So it needs to understand that if the month is now, then say 1, and if it is 1 month ago then display 2, and so on. So in essence it needs to be offset by 1. This can’t be coded in by hand, because I’m using this code in the archives and therefore it needs to work out the number for each month automatically.


~ Cameron

Offline

#19 2009-03-04 15:00:23

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Magazine Issues

You need to single-quote your tags-as-attributes.

Offline

#20 2009-03-04 15:06:45

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

jm wrote:

You need to single-quote your tags-as-attributes.

Okies fixed that thanks, just need to get it to display the issue number, any ideas? It would seem the only way to get this to work is be able to get an offset to work this plugin and it doesn’t support it, maybe the txp:variable idea would work better?

Last edited by driz (2009-03-04 15:31:59)


~ Cameron

Offline

#21 2009-03-04 17:20:11

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Magazine Issues

I don’t see a way for that plugin to only return the number of months.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#22 2009-03-04 17:34:32

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

Okies looks like I’m going to have to drop the Issue Number as its not possible with TXP without it becoming more trouble than it’s worth!

How could I make it so that I choose how many issues are shown? I tried using the limit=”“ attribute BUT that just alters the amount of articles displayed NOT the number of months displayed!

This is the code for my issues list:

<li>
<txp:if_different>
<h1 style="text-align:right;">Issue #</h1>
<h2 style="text-align:right;"><txp:posted format="%B %Y" /></h2>
</txp:if_different>
<h3><a href="<txp:permlink />" title="<txp:permlink />"><txp:title /></a></h3>
<h4>Published by <txp:author /></h4>
</li>

So what I’m wanting to do is get it so I show say 5 Months and then have a pagination, and then I can go to page 2 and see another 5 months! I’m trying to limit the months NOT the articles. Any ideas how to do this?

Last edited by driz (2009-03-04 19:53:21)


~ Cameron

Offline

#23 2009-03-04 19:51:34

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Magazine Issues

reshoo wrote:

Do hurry we are still waiting to see it

See what?


~ Cameron

Offline

#24 2009-03-05 04:13:08

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Magazine Issues

I’m sure you could write some php to count the number of months since a given date but my php skills are lacking.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

Board footer

Powered by FluxBB