Help - Search - Members - Calendar
Full Version: Compare Plugin -- Compare Years?
Movable Type Community Forum > Additional Resources > Plugin Development and Usage
bdhamilton
In one of my weblogs, I'd like to be able to test to see if the entry is dated before a certain year, and if it is, simple display the label "High School" instead of the specific date. I'm trying to use the Compare Plugin like this:

CODE
<MTIfEqual a="[EntryDate format='%Y']" b="2002" numeric="1">High School</MTIfEqual>

<MTIfNotEqual a="[EntryDate format='%Y']" b="2002" numeric="1"><$MTEntryDate format="%B %Y"$></MTIfNotEqual>


but it isn't working--I don't think that argument a is getting correctly passed. Does anyone either know why, or have a suggestion for a better way to do this? Thanks.
staggernation
You're missing "MT" in the names of the tags you're passing to the plugin. Try:
CODE
a="[MTEntryDate format='%Y']"
staggernation
You can also use the comparison tags in the DateTags plugin for comparing dates, but this seems simple enough that Compare will do the trick...
bdhamilton
Well don't I feel dumb--that works perfectly. Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.