Support Forums

Old 07-09-2007, 01:55 PM   #1
Junior Member
 
Join Date: Jun 2007
Posts: 11
Rep Power: 8
Nealm is on a distinguished road
Default Help with Smarty custom functions

I cannot get my smarty templete to see my smarty function. I placed the new function in the functions_checkout.php file. I placed the function in the step3.tpl.php template. When executed, nothing happens. As part of the debuging process, I removed most of the code so that it is now only a function and return as follows:

function smarty_function_gsdates($section)
{
$test=="This worked";
return $test;
}

The call in the template is:

{$smarty_function_gsdates}


Once I get the tempate to see the function, I will add in additional coding.
Nealm is offline   Reply With Quote
Old 07-09-2007, 06:24 PM   #2
Moderator
 
 
Join Date: Mar 2006
Posts: 4,176
Rep Power: 102
Lhotch is just really niceLhotch is just really nice
Default

Your intermixing php functions and smarty functions but it doesnt work like that.

Smarty functions can of course contain php but by default when you call a smarty function it looks in a predefined place for the function and is the same as running PHP code within a template. Try taking your function code above and put it in a file called....

function.gsdates.php

and place it in /includes/classes/smarty/plugins/

then if you call the smarty function in the template, it should look in that folder and execute the proper function.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 07-09-2007, 08:55 PM   #3
Junior Member
 
Join Date: Jun 2007
Posts: 11
Rep Power: 8
Nealm is on a distinguished road
Default

Thanks,

That lead me in the right direction. After a little bit of experimentation, I got it to work.
Nealm is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarty Templates and You. Posted BY Lhotch Eric Barnes HTML, CSS, and Design Help 13 10-02-2007 08:06 AM
Where is the custom field search function? MrSpandex v3.1 Modules & Modifications 3 12-08-2006 06:33 PM
Custom Payment Mod pruffin v3.1 Questions & Support 0 12-06-2006 12:34 AM
Custom Payment Provider? flyingpylon v3.1 Questions & Support 4 10-31-2006 03:49 PM


All times are GMT -4. The time now is 03:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0