开发者

ModX Evolution: ditto + phx code

开发者 https://www.devze.com 2023-03-28 22:12 出处:网络
I am trying to create XML from my pages using ditto snippet. 开发者_JAVA技巧I have ditto snippet with tpl to a chunk and in chunk I have this:

I am trying to create XML from my pages using ditto snippet. 开发者_JAVA技巧I have ditto snippet with tpl to a chunk and in chunk I have this:

<tour_id>[+tour-terms:get_tourid+]</tour_id>

tour-terms is a template variable and get_tourid is php code (in snippet phx:get_tourid) to filter text stored in tv.

All export to xml works only if I have only one page (startID is folder with one page in it). For multiple pages xml page refuse to load (server error 500). I expect some conflict between internal phx of ditto and phx snippet.

Could not find any solution, please help.


Solved. Problem was in functions I had in snippets. They have to be wrap inside a !function_exists conditional block:

if(!function_exists(rnCountRows)) { 
    function rnCountRows() { ... } 
}

in case they are run more then once on a page

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号