hi,
i want to include a php file but it doesnt works.
i have a php file named sidebar.php inside assets/templates/mytemp001/ .
From modx manager ive created a snipped named mysidebar which has following codes:
<?php
include("assets/templates/mytemp001/sidebar.php")
?>
then in my site template i added following after <p>[*content*] </p>
[*mysidebar*]
Now when i open my site, the sidebar part is not appearing.
sidebar.php contains some links of external sites.
-
☆ A M B ☆
- 24,524 Posts
Snippets use [[...]] tags, or [!...!] if you don’t want the snippet output cached (for instance, forms can’t be cached since the page needs to run the snippet again on submission to process the form).
-
☆ A M B ☆
- 24,524 Posts
Your snippet already has <?php and ?> tags. You will also need to adjust your external code to return something, and then in your snippet return it. For example, put your code’s output into a variable, then end your snippet with return $variablename;
it worked now: i changed php include to this
<?php
include "assets/templates/bblog2/resources/sidebar.php";
?>
thanks sotwell