Help - Search - Members - Calendar
Full Version: Smarty Tags Not Being Parsed
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
shyland101
I am so frustrated with trying to get smarty tags parsed.

I am embedding some smarty tags into my webpage in order to access MT information within php.

For example, I have included the following:

{{MTEntries lastn="10"}}
<p>{{MTEntryTitle}}</p>
{{/MTEntries}}

in an index.php file. I have enabled dynamic publishing, at least to the extent that it executes php. I have set up my .htaccess file as required.

These tags, however, are not being parsed and so are showing up as above on my webpage. Clearly, there is something missing, some magic switch I have failed to pull, some line of code I have not included that is causing this to fail. However, I do not have a CLUE as to why this is happening.

Nothing in the MT documentation, nothing I have googled, nothing I have read in "Hacking Movable Type" or any other resource gives me ANY insight into why this is occurring. Testbed page is http://s119778069.onlinehome.us/njdp/about/

So could someone who has a clue, clue me in on what could possibly be missing!

<FLAME>
Frankly, the real frustration is with the MT documentation. It is p*ss poor, particularly when it comes to dynamic publishing. No one should have to spend HOURS trying to get a so-called feature of MT working. There should be CLEAR examples including example code.

I'm no babe-in-the-woods when it comes to programming or technical issues, either. So if I'm frustrated, how much more frustrated is the average person who encounters MT? Give me one CLEAR, working example of an entire page that utilizes all of the features of dynamic pages and I could probably figure the rest out. But not from Brad Choate's documentation, or anyone else, for that matter.

SixApart may have the best product out there when it comes to blogging and CMS, but it's Achilles heel is its documentation. The company needs to keep its technical people far, far away from writing documentation and let real trainers and technical writers create a manual.
</FLAME>
lisa
Hi, I was able to put those exact lines into my dynamic template and it generated a list of entry titles for me. What version of PHP are you using? What version of MySQL? Could you provide a link to your mt-check.cgi so I could check on a few other versions?
shyland101
QUOTE (lisa @ Feb 10 2006, 12:21 AM)
Hi, I was able to put those exact lines into my dynamic template and it generated a list of entry titles for me. What version of PHP are you using? What version of MySQL? Could you provide a link to your mt-check.cgi so I could check on a few other versions?
*


Testbed links:
http://s119778069.onlinehome.us/njdp/scripts/mt/mt-check.cgi
http://s119778069.onlinehome.us/njdp/php_info.php

And what does your dynamic template look like? A code example would be extremely helpful.

Thanks
imabug
QUOTE (shyland101 @ Feb 5 2006, 08:14 PM)
I am so frustrated with trying to get smarty tags parsed.

I am embedding some smarty tags into my webpage in order to access MT information within php.

For example, I have included the following:

{{MTEntries lastn="10"}}
<p>{{MTEntryTitle}}</p>
{{/MTEntries}}

in an index.php file. I have enabled dynamic publishing, at least to the extent that it executes php. I have set up my .htaccess file as required.

These tags, however, are not being parsed and so are showing up as above on my webpage. Clearly, there is something missing, some magic switch I have failed to pull, some line of code I have not included that is causing this to fail. However, I do not have a CLUE as to why this is happening.

*


is this an index.php file that's being generated by an MT template? It's not going to work unless it's an MT generated file.

You can't just plunk Smarty tags into any old PHP file and expect them to be parsed. If you read the Smarty documentation, there are a few other things that need to be include()ed and done to make Smarty work.

Furthermore, you can't just plunk MT tags into any old file outside MT and expect them to magically get parsed if MT doesn't know anything about the file. The MT engine needs to go through the template, parse out the MT template tags, and spit out the correct HTML/PHP for the server to parse.
lisa
QUOTE (shyland101 @ Feb 11 2006, 03:07 AM)
And what does your dynamic template look like? A code example would be extremely helpful.


In a new Index Template, I set it to build dynamically and pasted in:
CODE
{{MTEntries lastn="10"}}
<p>{{MTEntryTitle}}</p>
{{/MTEntries}}

and nothing else.

The results show (obviously from my testing blog):
And another

Another entry for Feb

TB test

Roses

2nd test

Testing BlogJet

Testing TB

blockquotes

JN test
shyland101
QUOTE (imabug @ Feb 11 2006, 11:48 AM)
is this an index.php file that's being generated by an MT template?  It's not going to work unless it's an MT generated file.

You can't just plunk Smarty tags into any old PHP file and expect them to be parsed.  If you read the Smarty documentation, there are a few other things that need to be include()ed and done to make Smarty work.

Furthermore, you can't just plunk MT tags into any old file outside MT and expect them to magically get parsed if MT doesn't know anything about the file.  The MT engine needs to go through the template, parse out the MT template tags, and spit out the correct HTML/PHP for the server to parse.
*


Yes, these are Smarty tags that are in an index.php template that is being rebuilt by MT. The resulting file is being parsed to the extent that the MT tags are being parsed correctly and updated by MT, and when index.php is accessed, it is correctly executing the php and displaying the file.

It is apparently those "few other things that need to be include()ed and done to make Smarty work" that seems to be the problem. Like, what?!! You won't find that information in the MT documentation.

Look, I appreciate your assistance. I really do. You've given me more direction in one post than anything I've been able to find on the SA site, or by googling the web. If it weren't for forums like this, I would have dumped MT many months ago.

This hearkens back to my initial complaint/flame about the MT documentation. A simple example would be helpful, a slightly more detailed explanation would be nice, and a chapter in the documentation covering dynamic publishing in more detail than the information provided would be ideal.

Instead, the documentation currently consists of some rambling and partial assumptions that give no real guidance on and no mention of the "few other things" that need to be included in order to make this work correctly. Including a statement to "see the smarty documentation" isn't documentation, it is an excuse for a lack of documentation.

I'm no dummy; I've been writing software for many years, and have experience with OOD and OOP going back to 1983. I've developed APIs, I've documented them, and I've written and taught training for other software engineers. Although I am not fluent in php, I get the concept, and I can certainly read code.

The "new and improved" MT documentation is only marginally better than prior versions. There are major gaps in it and much of it still seems like an afterthought. My guess is that SA relies on programmers to develop their documentation and, frankly, few programmers can put together a coherent sentence, let alone create user documentation.
shyland101
QUOTE (lisa @ Feb 11 2006, 05:28 PM)
QUOTE (shyland101 @ Feb 11 2006, 03:07 AM)
And what does your dynamic template look like? A code example would be extremely helpful.


In a new Index Template, I set it to build dynamically and pasted in:
CODE
{{MTEntries lastn="10"}}
<p>{{MTEntryTitle}}</p>
{{/MTEntries}}

and nothing else.

The results show (obviously from my testing blog):
And another

Another entry for Feb

TB test

Roses

2nd test

Testing BlogJet

Testing TB

blockquotes

JN test
*

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.