Created my function in custom.php. I am trying to display it in a template with this line

<xsl:value-of select="document('udata://custom/gettimedata/')/udata" disable-output-escaping="yes"/> 

If I prescribe this, for example, in the xslt / blocks / footer.xsl file, then the function displays everything as it should. But if you register in xslt / layouts / default.xsl, where I need it, it does not display anything. How to display the result of the function in the default template?

  • Very strange. Place call should not affect. Try to turn on the error display (in the config.ini in the root, set the debug parameter to 1). Perhaps just somewhere above the macro call there is some kind of error. - Arthur Shiriev
  • @ArthurShiriev Please post your comment as a response. - Nicolas Chabanovsky
  • @ArthurShiriev thanks, helped. In the debug mode, an error emerged stating that the function returns a string in the encoding other than utf-8, fixed it and it all worked. - Mikhail Pavlov

1 answer 1

The location of the macro call should not affect its operation.

I recommend to enable the display of errors. Perhaps there is some kind of error when generating the page above the macro call.

To enable the display of errors in the config.ini file, which is in the root of the site, in the "debug" section, set the "enabled" parameter to 1.