Help - Search - Members - Calendar
Full Version: Dirify with PHP code in Dynamic Templates
Movable Type Community Forum > Additional Resources > Tips and Tricks
DaveVT5
KB Article: http://www.sixapart.com/movabletype/kb/cus...g_php_code.html

I have a simple question that research has not answered. I am using dynamic publishing and everthing that goes along with it (Smart, PHP)

I am simply trying to output the category name while using the dirify function as described in the KB article.

The article says:
QUOTE
To get what you want, you should invoke the functional way to retrieve tag content. For example:

<?php
$author = dirify($this->tag('MTEntryAuthor'));
?>


I am working from an individual archive template and wrote the code as such:
CODE
<?php echo dirify($this->tag('MTEntryCategory'));?>


When I load the template I get the following error:
QUOTE
Fatal error: Call to undefined function dirify() in /home/borderleap.com/htdocs/www/templates_c/%%63^63C^63C68147%%mt%3A16.php


I followed this post to create my own function to perform what dirify() does. When I loaded my page I got the following error:
QUOTE
Fatal error: Cannot redeclare dirify() (previously declared in /home/borderleap.com/htdocs/www/templates_c/%%63^63C^63C68147%%mt%3A16.php:106) in /home/borderleap.com/htdocs/www/mt/php/lib/MTUtil.php on line 253


Previsouly declared??? when I don't declare, it says I am using an UNDECLARED function.

What gives?
sarah
You might get some ideas from this topic.

p.s. I've edited your topic title to something more specific to your question - more people are likely to respond that way. wink.gif
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-2009 Invision Power Services, Inc.