+ Reply to Thread
Results 1 to 3 of 3

Thread: How to use regex_replace on description field in smarty

  1. #1

    How to use regex_replace on description field in smarty

    I want to do some regex_replace on description field. As description field also sometimes contain phone numbers, I want to hide those numbers,and show them on click. I already have jquery code that will hide numbers, but I need to do regex_replace on description field.

    smarty code that I am trying is, to put this in field_out_value.tpl

    PHP Code:
    Only registered members can view the code
    This trows me error. What I am doing wrong?


    My jquery code is in footer.tpl

    Only registered members can view the code.

  2. #2
    Great flynax support provided solution.

    It should be done in php code, not presentation part (smarty template)

    File to modify: include/classes/rlCommon.class.php

    line 791:

    PHP Code:
    Only registered members can view the code
    I think that regex is not perfect, it will also select 1000-2000 eur (which is not phone number) but you can modify regex as you want.

  3. #3
    Kenan would you mind sharing with me your site so I can see how your code work with hiding phone number?
    Thank you

+ Reply to Thread