-
- 788 Posts
Looks like the character case is wrong - instead of
should be
-
- 95 Posts
Thanks Breezer, that got rid of the fatal error.
The placeholders do not work if PHx is enabled but at least the page now displays.
I never use the PHx plugin. It eats external placeholders. I suspect an error in the regular expression used in its own garbage collection function; it should only remove its own unused placeholders. If you must use the plugin, then instead of a placeholder in your content you’ll need to use a snippet with $modx->getPlaceholder(’placeholder-name’). The placeholder’s value is still in the placeholder’s array, it’s just that phx has eaten the tags. Ditto and Jot tpls using their own phx classes aren’t affected by this; it’s only when using placeholders in the main templates or content where the plugin causes the problem.
As far as that book goes, I was given a copy and asked to put a review on my site. I read through the book and decided to follow my mother’s advice: "if you can’t say something nice, don’t say anything at all". It’s full of nasty errors like that; the author is a fine developer as the introductory chapters will show, but he doesn’t know any more about MODx than any reasonably competent developer would know after installing it and looking at it for a bit. I was a technical editor for its first edition, and cleared up the more obvious errors like $MODx instead of $modx, but the editors of this edition don’t know any more about MODx than the author does. While it covers the basics of MODx as a CMS reasonably well (other than referring to the wrong modules and plugins from time to time) it won’t do anybody much good if they’re trying to actually do anything besides show pages.
-
- 95 Posts
Thanks for the $modx->getPlaceholder(’placeholder-name’) tip which works well. I did try gettting it return two placeholders from one snippet but without any luck, so long term I’m going to have to drop PHx.
I haven’t seen the second edition of the MODx Web Development book but the first edition was a disappointment, especially given its price. The brief sections on filtering, MODx API and the blog were quite helpful, but your comments are an accurate summary of its usefulness sadly.