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

Thread: Listing Fields

  1. #1

    Listing Fields

    Hello, What is the best way to put a label next to the field on the page?
    Ex: Condition: New (Condition being the label) Can I enable the label in the admin, or do I have to add it into the templates?

    I have tried using the template, in this case listing.tpl, and when I put:

    Code:
    Only registered members can view the code.
    I am getting countries_united_states as the output on screen. If I put:

    Code:
    Only registered members can view the code.
    I am not getting anything on screen.
    Last edited by Brian Jester; May 30, 2019 at 03:50 AM.
    Thank you - Your Welcome
    Brian

  2. #2
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Posts
    920
    Hello,

    The best way to display field names is to enable this feature in Common > Basic Settings > Browse Form Settings > Field names in browse form

    or use manually in the code {$listing.fields.country.name}
    Last edited by Rudi; May 30, 2019 at 03:39 AM.

  3. #3
    Quote Originally Posted by Rudi View Post
    Hello,

    The best way to display field names is to enable this feature in Common > Basic Settings > Browse Form Settings > Field names in browse form

    or use manually in the code {$listing.fields.country.name}
    Rudi, for some reason that code didn't work (manually) and when I went to the basic settings browse form settings and enabled that in the browse form, it still wasn't showing anything. I am going to check again, but I did take my time to make sure it was correct.

    In my listing.tpl I put this code:

    Test {$listing.fields.country.name} {$listing.country}

    Which should display: Test United States United States but I am getting Test countries_united_states
    Last edited by Brian Jester; May 30, 2019 at 04:11 AM.
    Thank you - Your Welcome
    Brian

  4. #4
    Please remove your code:
    Code:
    Only registered members can view the code.
    and add my code:
    Code:
    Only registered members can view the code.
    Viktor,
    Flynax technical department,
    Best wishes.

  5. #5
    Quote Originally Posted by Viktor View Post
    Please remove your code:
    Code:
    Only registered members can view the code.
    and add my code:
    Code:
    Only registered members can view the code.
    Let me ask you this Viktor, will that code be the way to do it all the time if I use the template as opposed to {$listing.Fields.country.name} {$listing.country}[/code]? Or is this way only to display country?

    Also, that code to display the country name label, and the country itself I have in the listing.tpl file, all looks good, except on the gallery tab view, I don't want the location on that page, so what template should I put that code into? I know it works, so that's not the problem, just the template. Actually, I spoke too soon...That is ok in the gallery view. Just have to limit what goes into that page. But if you have other suggestions on what template to work in so that I don't have to think too hard as to what fields I can and can't use because of 'limited space on the page' that would help.

    Thank you Viktor!
    Last edited by Brian Jester; May 30, 2019 at 03:34 PM.
    Thank you - Your Welcome
    Brian

  6. #6
    Hello Viktor,

    In regards to the code you posted for the country, how would I do that for phone? I have already tried replacing country with phone but that did not work, it output 'garbled' data code.
    Code:
    Only registered members can view the code.
    Thank you - Your Welcome
    Brian

  7. #7
    Let me ask you this Viktor, will that code be the way to do it all the time if I use the template as opposed to {$listing.Fields.country.name} {$listing.country}[/code]? Or is this way only to display country?
    If you want to use {$listing.Fields.country.name} you need to add country field to browse form at frist. Go to Admin Panel >> Categories click build icon and choose: Build Browse form. Because by default in: {$listing.Fields} doesn't exist any fields.

    I have added field here: https://www.worldclassads.com/classi...orm=short_form
    and please check the listing on category page: https://www.worldclassads.com/classi...tes/community/

    I don't understand why do you want to use each field manually.
    Viktor,
    Flynax technical department,
    Best wishes.

  8. #8
    Hello Viktor,

    That's the thing Viktor, I would use the forms normally, but for example, when using the browse form to add a field, it was either not appearing or gave garbage output like in my previous example. That is why I asked you for the code to manually add it. So if I understand you correctly, I have to add the field to the browse form first, then add {$listing.Fields.field.name} to the template? Now why would I have to add anything to the template? I would prefer to just use the form, which brings me to this question, what did you do to make the phone field work in the form? I understand you commented out the previous code I removed it for country and label: {* phrase key='data_formats+name+'|cat:$listing.country} {phrase key='data_formats+name+'|cat:$listing.country_leve l1 *}
    also, in the admin panel I did Listing Types, clicked edit for community then build listing form then browse form added field, that is the same way as you correct?

    Quote Originally Posted by Viktor View Post
    If you want to use {$listing.Fields.country.name} you need to add country field to browse form at frist. Go to Admin Panel >> Categories click build icon and choose: Build Browse form. Because by default in: {$listing.Fields} doesn't exist any fields.

    I have added field here: https://www.worldclassads.com/classi...orm=short_form
    and please check the listing on category page: https://www.worldclassads.com/classi...tes/community/

    I don't understand why do you want to use each field manually.
    Thank you - Your Welcome
    Brian

  9. #9
    Hello Viktor,

    I have figured it all out, I add a fax number just for example on the browse form. I feel so good right now! I didn't have to add code manually, just use the browse form. It's new to me, but it's getting easy now.


    Quote Originally Posted by Viktor View Post
    If you want to use {$listing.Fields.country.name} you need to add country field to browse form at frist. Go to Admin Panel >> Categories click build icon and choose: Build Browse form. Because by default in: {$listing.Fields} doesn't exist any fields.

    I have added field here: https://www.worldclassads.com/classi...orm=short_form
    and please check the listing on category page: https://www.worldclassads.com/classi...tes/community/

    I don't understand why do you want to use each field manually.
    Thank you - Your Welcome
    Brian

  10. #10
    Hello Viktor,Edit: I got it!This is what I did: I added this to listing.tpl:

    Code:
    Only registered members can view the code.
    My question though that still remains, can I accomplish the same (putting country, state, city on one line) using browse form only?

    I am guessing no, but thought I would ask.

    I am having some troubles with this again. I want to put the Country State City in the browse template, but in one line, Like: United State Miami, Florida so I assume I will need to be using the template. Can you make tell me how that is done? I use the browse form, but like I say, i want them to be on one line: Country State, City format. I don't know if this has to be done in template or browse form
    Last edited by Brian Jester; May 31, 2019 at 06:09 PM.
    Thank you - Your Welcome
    Brian

+ Reply to Thread