Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#161 2009-11-13 06:53:21

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

I would like to output an unordered list instead of a definition list because I only have one year to display.

I noticed in your plugin source code there is a provision for using <ul>, but can’t see an attribute to change this in the <txp:upm_date_menu /> tag. Otherwise, is it a simple matter of changing all your <dl> to <ul>, <dd> to <li>, and commenting out the <dt> in the plugin source code???

Edit:

I’ve since read more of the replies in this post, and decided to use my own menu list that takes advantage of the urls this plugin generates. Thanks anyway.

BTW: I understand why requests for a month with no articles are not redirected to a 404 page, but is there some conditional tag I could use to generate a brief statement, when such an event occurs?

Last edited by speeke (2009-11-13 09:48:34)


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#162 2009-11-18 09:46:49

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

Look at the “none_found” attribute described in the plugin’s help doc. :)

Offline

#163 2009-11-18 10:06:18

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

Thanks for your reply, Mary.

However, I’m using the upm_date_menu tag which, if I’m not mistaken, doesn’t have a “none_found” attribute.


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#164 2009-11-21 00:31:47

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

I think we’ve got things confused.

Earlier you said that you decided to not use the upm_date_menu tag in favour of generating the links yourself. If you’re also not using the upm_date_archive tag, and using, say, the article tag instead, then you’re not using the plugin at all. Not a problem, per se, except that if you’re not actually using the plugin tags they can’t very well do anything for you. :)

In that instance, you would need to investigate using the if_data plugin someone else has written.

Offline

#165 2009-11-22 21:23:32

speeke
Member
From: Bruny Island, Australia
Registered: 2009-03-29
Posts: 161
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

Many thanks for getting back, Mary.

You’re absolutely right, in all my experimentation with various plugins, and their options, I’ve been changing my mind a fair bit – causing all sorts of confusion – sorry ;)

In the end, I decided to add my own rewrite rules to the Txp .htaccess file instead, so that I can customise the date formats based on yyyy-mm-dd, yyyy-mm and yyyy. But I will certainly keep your plugin in mind for another project I’m working on.

Cheers :)


“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower

Offline

#166 2010-02-11 11:09:08

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

I can get this plugin working perfectly with messy urls but when I switch to clean (/title) the date_archive does not work.

For the date menu my code is:

<txp:upm_date_menu id="archivemenu" insert_empty_months="no" sort="the_year desc, the_month desc" month_format="%B" show_article_count="yes" />

and for the date archive my code is:

<txp:upm_date_archive form="archive_view" mode="smart" heading_level="4" include_date="no" sort="the_year desc, the_month desc, the_date desc" />

If I use mode="full", I get the archive list (apm_date_archive) working but when I want to have a single month displayed by clicking an item on the upm_date_menu list, the same appears (2 months worth of posts)

Any ideas?


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#167 2010-02-11 11:30:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

That’s because of how /title works, if I remember correctly. Try switching to, say, /section/title and see if it suddenly starts working again.

Offline

#168 2010-02-11 12:07:45

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

Hi Mary, thanks for responding so promptly; switching to /section/title works perfectly so thanks for the help. Is there any chance that switching back to /title would make this plugin work?

On a side note, I found it extremely difficult to work out how to use this plugin, was there some documentation, apart from the plugin’s help, that I missed? I checked your site, textpattern.org and read through this entire forum thread but nowhere did it give any example uses and guides. Maybe I missed them, I don’t know, just FYI. It would be good to have it somewhere.


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#169 2010-02-11 12:22:29

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

I have another issue that I hope you can help me with, when a user goes to /archives I would like a list of articles from the current month, but when they click the date_menu items, I would like proper results to appear instead.

I have tried to introduce variables so that when a given url is correct, the form does one thing, to no avail. You can also see that I have an article_custom that grabs the current month’s articles.

My code is this:

<txp:variable name="archive" value='<txp:site_url />archives/' />
    <txp:if_variable name="archive" value='<txp:site_url />archives/'>
    	<txp:article_custom limit="999" wraptag="ul" break="" month='<txp:php>echo date("Y-m");</txp:php>' sort="Posted desc">
    		<txp:if_different>
    			<li class="month"><h4><txp:posted format="%B" /> <txp:posted format="%Y" /></h4></li>
    		</txp:if_different>
    		<li>
    		    <p class="title"><txp:permlink><txp:title /></txp:permlink></p>	
    		</li>
    	</txp:article_custom>
    <txp:else />
        <txp:upm_date_archive form="archive_view" mode="smart" heading_level="4" include_date="no" sort="the_year desc, the_month desc, the_date desc" />
    </txp:if_variable>

What am I doing wrong? Is there a better way to achieve this? Many thanks

Last edited by rathersplendid (2010-02-11 12:23:40)


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#170 2010-02-11 12:26:54

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_date_archive: Date archive listings

Nope, it’s a quirk of how the /title scheme works.

If I use mode=“full”, I get the archive list (apm_date_archive) working but when I want to have a single month displayed by clicking an item on the upm_date_menu list, the same appears (2 months worth of posts)

That’s because full is being used: that tells the plugin to display a list of all articles all at once. It’s really intended that the menu tag doesn’t get used when you use that mode.

When I update this plugin, I’ll make it so that you can optionally have the most recent month of articles displayed if no specific month has been requested.

Offline

Board footer

Powered by FluxBB