[solved] Using Availability Module variables

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mrchristoph
Forum Members
Forum Members
Posts: 20
Joined: Sat May 15, 2010 9:54 am

[solved] Using Availability Module variables

Post by mrchristoph »

Hi,

I am trying to incorperate some PHP to strip hyphens and remove the last 4 digits from a string to display image files in a pretty way. The PHP goes like the following:

 

Code: Select all

 $name = str_replace('_',' ',{$field.value}); 
    $name = substr($name,0,-4); 
    echo $name; 
Problem is, the {field.value} is a variable within the Availability module, and no matter what I do I cannot seem to get a UDT to recognise this variable. I have also tried the other way round, putting {php} tags into the Availability template to no avail.

Can someone explain to me the proper way to do this please, I'm going round the bend!

Many Thanks
Last edited by mrchristoph on Thu Jul 22, 2010 10:49 am, edited 1 time in total.
mrchristoph
Forum Members
Forum Members
Posts: 20
Joined: Sat May 15, 2010 9:54 am

Re: [solved] Using Availability Module variables

Post by mrchristoph »

Well i solved this by creating a UDT with a parameter of item. In the template I call the UDT with the parameter item={$field.value} and hey presto it works!

Hope this can be of some help to people.
Post Reply

Return to “Modules/Add-Ons”