I'm not sure if I'm even asking this question right: The website I'm updating is written in PHP an Smarty and since I wouldn't consider myself a programmer in either I'm running into a bit of trouble. What I'm trying to do is call an rss feed based on the page title. I was able to get the page title to show up on the tpl page within {php} but I can't seem to set it as a variable. Here's what I'm trying: $rss_keyword = echo $this->_tpl_vars['title'] Code (markup): What am I missing?
You can use eval() to execute a string as php. However, I am not sure I quite understand what you're trying to do by your description.
Thanks SeLfkiLL I'm not really sure I understand what your saying either Say the title of the page is Chocolate and echo $this->_tpl_vars['title'] Code (markup): figures that out based on the page title. In this case I want to Chocolate to be the $rss_keyword So $rss_keyword = 'Chocolate' Code (markup): Does that help at all
You might try: $rss_keyword = $this->_tpl_vars['title']; Code (markup): The way you have written the code will generate a parse error because you cannot have something equal to the result of an "echo" statement. PHP will complain that it has encountered an "unexpected T_ECHO"
$this->_tpl_vars["rss_keyword"] = $rss_keyword; echo $this->_tpl_vars["rss_keyword"] PHP: I think you want that ..... then you'll have the rss keyword inplace of the title, and take notice of post above.
krakjoe - How would the site know what the title of the page is to use as the rss_keyword with your example? I think I'm missing something.
Your answer works when I test it with something simple like echo $rss_keyword Code (markup): I just didn't realize it because the RSS Reader I'm using, CARP, is throwing an error. Thanks for everyone's help I may just not be able to pull stories on the fly with carp.