+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

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
    3,138
    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
    3,138
    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
    3,138
    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

  9. #9
    Quote Originally Posted by Rudi View Post
    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
    Hello Rudi,

    The first solution is not worked with me, so I tried the second solution but the country code (999) replaced by Area code instead of Country code. Screen Shot 2020-07-30 at 3.59.57 AM.png

  10. #10

+ Reply to Thread