Archive Script

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Archive Script

Postby Justin » Fri Jan 03, 2014 10:53 pm

Hi all,

Is there a script which can show the archive in years then in months for the current year?

E.g.

Archive

2011
2012
2013
2014

2014 Monthly Archive

January 2014
February 2014


I've been playing around with the code but don't seem to be able to script current year and month archive.

Many thanks,

Justin
Justin
 
Posts: 17
Joined: Sun Jan 20, 2013 3:02 pm

Re: Archive Script

Postby Justin » Fri Jan 03, 2014 11:04 pm

Worked out Yearly...

<ul>
[[archive_list
unit='year'
order='asc'
format='<li id="%st_year%"><a href="%url%">%st_year%</a></li>'
]]

</ul>

But would like Monthly for current year to work alongside.
Justin
 
Posts: 17
Joined: Sun Jan 20, 2013 3:02 pm

Re: Archive Script

Postby Harm10 » Fri Jan 03, 2014 11:06 pm

Currently there isn't but this seems like a logical expansion of the existing code.
But then someone has to find the time to create it....... I see what I can come up with.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive Script

Postby Justin » Fri Jan 03, 2014 11:13 pm

Thanks again Harm10!
Over the last few days you have been great!
Justin
 
Posts: 17
Joined: Sun Jan 20, 2013 3:02 pm

Re: Archive Script

Postby hansfn » Fri Jan 03, 2014 11:43 pm

No, we shouldn't extend the archive_list tag for this - just use the subweblog tag. To get some ideas, see the Archives examples on http://book.pivotx.net/page/app-c (You can limit the example to the current year by using the date argument.) If you don't get it on your own, Harm can help you.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Archive Script

Postby Harm10 » Sat Jan 04, 2014 10:46 am

I wasn't thinking of something too complicated....... Just something like a starting and an ending date so anyone can limit the output of the archive_list.
What Justin wants is only the links to monthly archive pages of the current year. It seems to me that using a subweblog structure is a bit too complicated for users that have less experience just for this topic.
Adding such extra params would give users the possibility to output links to months until an ending date. They would have to use the archive_list tag again for the output of the year links. So no complex things in one go.
Is this still a no go?
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive Script

Postby Justin » Sat Jan 04, 2014 3:53 pm

Harm10, I don't want to get you into trouble, but thank you for trying to help.

I will manually edit each month, if not just have a yearly archive.
Justin
 
Posts: 17
Joined: Sun Jan 20, 2013 3:02 pm

Re: Archive Script

Postby hansfn » Sat Jan 04, 2014 4:29 pm

Is this still a no go?

No, adding date, start and end arguments to the archive_list tag, similar to the the subweblog tag makes very much sense. I was objecting to making archive_list produces both yearly and monthly archives in one go.

It seems to me that using a subweblog structure is a bit too complicated ...

I agree in general, but the idea was that you made a solution once and then added it to the PivotX book (like the other examples).
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Archive Script

Postby Harm10 » Sat Jan 04, 2014 7:30 pm

I will continue trying to introduce a start and end date for the archive_list.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Archive Script

Postby Harm10 » Wed Jan 08, 2014 6:59 pm

Hans and I made some changes to the code so your suggestion is now possible.
You can either wait on the next release or get the changes from svn: https://sourceforge.net/p/pivot-weblog/code/HEAD/tree/branches/2.3.x/pivotx/
You need to pick up the latest version of lib.php and modules/module_smarty.php.
The parms are documented on the template page http://book.pivotx.net/index.php?page=app-b and an example can be seen on http://book.pivotx.net/page/app-c#anchor-mixing-month-and-year-links

If you need more help please feel free to ask.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron