Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Calguy's solution only works when you have plain text. It crashes when you have smarty tags within the text. What I want to do is what the old method did, ie evaluate the field contents before returning the output.
I've read (tho probably not fully comprehended) the smarty docs and still can't figure out how to do it.
Calguy's post helped but it wasn't the full answer. Actually found the solution by reading through the index.php code. There was a comment around line 226
But I would also be interested into how to make it backwards compatible to CMSms 1.10?
Also I ask myself why it would be necessary to break plugins and modules for such a little convenient function
Maybe the deprecated status on ProcessTemplateFromData could be reconsidered?
A good question for the dev team, along with others like why has "CreateToolTipLink" been deprecated? Very handy little method and the only alternative I found was the cumbersome "CreateLink".
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
-------------------- If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Thanks Calguy. Understand better now how it works.
FWIW, below are results returned when using the new smarty method to compile the main content block of a page, content_en, programmatically from within a module admin area:
{sitename} : worked correctly and displayed the correct sitename
{title} : compiled but displayed "404 Error"
{cms_module module=News} : compiled and displayed correctly
{news} : returned error "Warning: file(C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatebase.php(147) : eval()'d code) [function.file]: failed to open stream: No such file or directory in C:\wamp\www\xxx\lib\misc.functions.php on line 2263"
{cms_selflink} : compiled and displayed correctly
{custom_copyright} - crashed badly with "Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "2578f763fa0bd97b6b8e3f65fcbab500098a6933" on line 1 "<p>Congratulations! The installation worked. You now have a fully functional installation of CMS Made Simple and you are <em>almost</em> ready to start building your site.<br /><br />{custom_copyright}<br /><br />This is the site name {sitename}<br />this is the title {title}<br /><br />full module tag: {cms_module module=News}<br />plugin form of News tag {news}<br />cms selflink tag: <a href="{cms_selflink href='how-cmsms-works'}">How CMSMS Works</a><br /><br /><br /></p>" unknown tag "custom_copyright"' in C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatecompilerbase.php:656 Stack trace: #0 C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatecompilerbase.php(441): Smarty_Internal_TemplateCompilerBase->trigger_temp in C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 656"
{$myvar} - var assigned in page template out of scope of {content} : did not compile which is understandable however rather than ignoring the var it returned the error "Notice: Undefined index: myvar in C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatebase.php(147) : eval()'d code on line 13
Notice: Trying to get property of non-object in C:\wamp\www\xxx\lib\smarty\sysplugins\smarty_internal_templatebase.php(147) : eval()'d code on line 13"
In short, seemed that core modules and plugins compiled but any tag that was user related, esp the UDT had problems.
Not passing any comments or judgements, just giving some feedback on results of my testing in the hope they may be useful to dev team.
User defined tags are not loaded in the admin in 1.11
"eval:{content}" and "eval:{content_image}" and other such tags will not work in the admin as there is no concept of a current frontend page when working in the admin.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
-------------------- If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User defined tags are not loaded in the admin in 1.11
Does module_custom still work?
There have been occasions in the past when a client has wanted something unique in the admin area of a module and I've used this dir to override the default admin template and included UDTs.