Quote from: Roberto at Dec 17, 2009, 08:15 AM
Can you briefly explain how the yams parser works?
I’ve started to write some
documentation on how the parser works... but that is probably too detailed for your requirements. You’ll probably find the
YAMS placeholders documentation more useful for what you want.
Quote from: Roberto at Dec 17, 2009, 08:15 AM
With YAMS placeholder do I have only 1 query per page?
If you use the [tt](yams_data:...)[/tt] placeholder then you will have 1 database query per 50 [tt](yams_data:...)[/tt] placeholders. You can change this value by changing the constant called [tt]YAMS_DOC_LIMIT[/tt] that’s at the top of [tt]assets/modules/yams/class/yams.class.inc.php[/tt] if you wish. The larger it is, the more data it will grab from the database in one go, and the greater the memory requirements of the computer/server you are using - so there is some sort of compromise to be struck.
Quote from: Roberto at Dec 17, 2009, 11:23 AM
I can’t use YAMS placeholders, because in my snippet I need to check the values of the TVs.
I understand. I’m not sure how complicated your logic is, but if it is simple (if the placeholder output is empty then do one thing else do another for example) then you could continue to use the placeholder and use PHx for the logic. This may not be the best solution, but I thought I would mention it.
Quote from: Roberto at Dec 17, 2009, 11:23 AM
I can call via $modx->getTemplateVarOutput() only those TVs that contains decisional data, and use YAMS placeholders for the rest; at least my queries will be shortened.
Good idea.