Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How to Create a Date Based Breadcumb Trail?
johnstephens wrote:
Awesome, Stef— in my quick test, this code block worked like a charm!
No probs. Glad it hit the spot.
Are there any notable drawbacks or benefits either way?
Don’t think it matters much. It’s “cleaner” to make non-erroring PHP and if you come back to the site in 3 years’ time and switch debugging mode on you might then spend ages scratching your head about the warnings. But if you’re not OCD about things, then leaving warnings won’t harm anyone; it’s just ugly.
If you know there’s a chance that the warnings will appear but you really don’t care, you can always cheat and do this:
list($variable['has_year'], $variable['has_month'], $variable['has_day']) = @explode('-', "$pax_get_date-");
The preceding ‘@’ will silence any warnings / errors. Just don’t let Gocom catch you doing it :-p
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline