View Single Post
Old 09-30-2007, 07:58 PM  
RedShoe
赤い靴 call me 202-456-1111
 
RedShoe's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: The Valley
Posts: 14,831
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)
__________________

SPECIALTY COSTUMES • PROPS • FX
Superheroes • Monsters • Robots
PM for details


For any manufacturing needs. Adult or otherwise.

aka BonsHigh on Insta
Bonsai weed plants


RedShoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote