![]() |
anyone here know how to...
I have a simple Smarty site going. So far so good, but I can't get it to do one thing. The index.php is set up to display: a header, a main, and a footer set of templates.
That part works but inside the main.tpl, I use the fetch function to call in a gallery like page. That gallery page is created from a database using a different program. (if I knew how to do it with Smarty I would) However, I'm using the fetch function and trying to call in a page, the actual function looks like this: {fetch file='http://www.domain.com/directory/videos.html'} Now the problem is, I need for "directory" be dynamic. It needs to use a smarty function so that I can replace that directory depending on the main page they are on. I've tried making it look like all of the following ways, and none of them work. {fetch file='http://www.domain.com/$directory/videos.html'} {fetch file='http://www.domain.com/\$directory/videos.html'} {fetch file='http://www.domain.com/\'$directory/videos.html'} {fetch file='http://www.domain.com/{$directory}/videos.html'} {fetch file='http://www.domain.com/'$directory'/videos.html'} if I hardcode the directory into the fetch function it works with no problem, but then that would mean I'd need a different template for each page, and the whole point of going with Smarty is to eliminate all those pages. Anyone know how to call a smarty instance into a fetch function? (or know of an alternative) |
Sorry, I cannot help you but here is a bump
|
Sorry mate I don't know either, but bump for someone else that might know
|
Quote:
Use double quotes. {fetch file="http://www.domain.com/$directory/videos.html"} |
Quote:
HOLY SHIT!!!! THAT WORKED!!!! Thanks DVAE!! |
admins, you may close this thread now.
|
Quote:
ADG |
Quote:
Single quotes are literal, meaning it will display exactly what you put in it.- No interpolation Whereas double quotes do. |
sounds stupid but ...
oops you got it
|
what's Smarty? do u have a link for more info?
|
Quote:
http://smarty.php.net/download.php |
All times are GMT -7. The time now is 10:12 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123