Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4 Questions & Support

Notices

 
LinkBack Thread Tools Display Modes
Old 02-16-2009, 02:24 PM   #1
Member
 
Join Date: Aug 2008
Posts: 68
Rep Power: 5
nagrap2 is on a distinguished road
Default Call Smarty Modifier Function Syntax

Hi,

I have written my own modifier plugin with the following header, please can someone tell me what is the syntax to call this from within a tpl file?

function smarty_modifier_custom_output_age($date_of_birth)

I have tried the following but get an error:

{custom_output_age date_of_birth=$extra}
__________________
Many Thanks,

Nagrap2

Developer Version 4.1
nagrap2 is offline   Reply With Quote
Old 02-16-2009, 02:33 PM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,847
Rep Power: 111
Eric Barnes is a jewel in the rough
Default

I think you need to rename it to smarty_function_custom_output_age($date_of_birth)

Quote:
Modifiers are little functions that are applied to a variable in the template before it is displayed or used in some other context. Modifiers can be chained together.

Then it could be called in the template as: {custom_output_age date_of_birth=$extra}
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 02-16-2009, 02:48 PM   #3
Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,397
Rep Power: 41
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

I think that you actually need to name the Smarty function file itself:
smarty_function_custom_output_age

Within the file, you need to have your function with this type of syntax:
function smarty_modifier_custom_output_age($date_of_birth)

Then you call the function from within your tpl file like this
{custom_output_age date_of_birth=$extra}

-Mike
__________________
Mike-N-Tosh
v3.1.10 Developer IndianaPC.org - A community website
Sandbox v4.0.9, 4.1
Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds.
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh 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
Modifying smarty function HotAir v3.1 Modules & Modifications 5 06-15-2008 03:23 PM
Smarty Function for Top Listing Soleiltan v3.1 Questions & Support 1 02-05-2008 08:24 AM
What do you call this? / Eric Barnes Off Topic 5 06-16-2006 06:53 PM
Call from userjoin.php to terms page???'s dawyatt v3.0 Questions & Support 7 04-24-2006 01:40 PM
Help needed with syntax Maffo v3.0 Questions & Support 3 04-24-2006 11:43 AM


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


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