+ Reply to Thread
Results 1 to 8 of 8

Thread: Phone number not correct.

  1. #1

    Phone number not correct.

    Good day.

    I try to print the phone number in the listing.tpl template.

    {$listing.phone_number}

    On an output I receive
    c: 7983 | a: 321 | n: 5599

    How do I correctly do this.

    Template: Escort Wide

  2. #2
    one way could be
    {$listing.phone_number|replace:c:':' '|replace:'a: ':' '|replace:'n: ':' '|replace:'|':''}

  3. #3
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    1,024
    Hello,

    You can get your value using this path: {$listing.fields.phone_number.value}

  4. #4
    2 Rudi

    How do I add in $listing.fields I have only the country and country2.

  5. #5
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    1,024
    You should go to Categories > Categories > your primary category or parent category > Build > Build Browse Form > add fields you need
    and then use them: {$listing.fields.your_field_key.value}

    but you should disable them for standard displaying:

    find <li class = "fields"> and add your field to {if...} area like this:

    Code:
    Only registered members can view the code.
    Last edited by Rudi; January 18, 2018 at 09:59 AM.

  6. #6
    Yeeeehaaaaaaa Rudi very very thanks )))))

  7. #7
    2Rudi

    Another question, perhaps when adding a new profile by default, set the country code when adding a phone.

  8. #8
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    1,024
    By default, there is no such feature
    it can be implemented as a customization

    but you can set a default value for 'code' section that will be always displayed on profile form:
    for that you should go to templates > your template > tpl > blocks > field.tpl > find a row "{elseif $field.Type == 'phone'}" > in first "input' change a code

    from:
    Code:
    Only registered members can view the code.
    to:
    Code:
    Only registered members can view the code.

    If you need to use multiple codes to allow user to select his code you can do the following:

    go to Common > Data Entries > create an entry with necessary country codes
    then go to Listings > Listing Fields > your phone field > Edit > Link to Data Entries > select your country codes entry
    in 'Field format' uncheck 'Code' option > Save

    And now the 'Area' part will be represented as 'Code' section with dropdown list on profile form

+ Reply to Thread