I tried putting some PHP code into the default.master.tpl file of my template in an attempt to load the wordpress header.php, but it does not get parsed. When I view the source online, the PHP code is unchanged and appears to just be ignored. I also tried wrapping it in the {literal} tag to no avail. Can someone tell me if it's possible to embed PHP in this file?
0 · ·
Comments
Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·What do you mean under "function reference API"?
Vanilla uses MVC(Model-View-Controller paradigm) and objects.
Plus event handlers as very useful helper approach.
Read about all this in documentation on this site.
Plus use good IDE (I prefer PhpStorm 2.0) and look into code (it is of quite high quality, many places are commented, arguments are also described according to PHP Doc)
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·My understanding is that you can make exactly the same documentation using Doxygen and Vanilla source?
As for Smarty - I asked not about how to use Smarty, but on how not to use it, in, for example, Mobile theme. I heard something about taking compiled PHP versions out from the Smarty cache.
- Spam
- Abuse
0 · Insightful Awesome LOL ·To use PHP templates, just call your files .php instead of .tpl. PHP template files override Smarty versions afaik.
Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·If you must do a full path (i.e. the files are outside Vanilla) then you must use the relative or full system path to the file ('../../folder/file.php' or '/var/www/vhosts/folder/file.php'). You generally can't include over http.
Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·I suppose I can get live with that, but it means I have to move my website wrappers into my Vanilla theme instead of where they belong ... in the website theme.
Vanilla also strips out unclosed div tags from these includes, which is crummy. It's very common when writing wrappers to open a div in a header and then close it in a footer. Vanilla seems to be forcing me to move the wrapper portion into every file that uses the header and footer, which sort of defeats the purpose.
- Spam
- Abuse
0 · Insightful Awesome LOL ·Also since Vanilla strips the unclosed div tags, I can leave then in the header and footer where they are used throughout the rest of the site, and only need to add them the theme files, which is manageable.
- Spam
- Abuse
0 · Insightful Awesome LOL ·If you still are interested in including PHP within your template you can use the {php} built-in function. smarty.net/docs/en/language.function.php.tpl
- Spam
- Abuse
0 · Insightful Awesome LOL ·no with the default settings. not all smarty tags are enabled.
Also if you are including php, you might as well copy default.master.php over and use that instead. Using php in a template language defeats the point of using a template language.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
0 · Insightful Awesome LOL ·