How select which field is mandatoy and how hide Map from one specific post type

This topic contains 5 replies, has 2 voices, and was last updated by  Guust 8 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #289588

    giuseppe cuttone
    Buyer
    Post count: 242

    Hi, thanks for add the option “mandatory fields” and “NOT mandatory fields”.
    At this time, if I have understood well, the option “Is required” runs automaticaly for all the 4 field (state, region, city and street)
    I would have preferred to indicate for each field who “is mandatory fields” and who “is NOT mandatory fields”.
    So, for example I could have set the following:

    So my question 1 is:
    1. How is possible to make the following setting, only for one specific post type?

    State: mandatory fields
    Region: mandatory fields
    City: mandatory fields
    Street address: NOT mandatory fields

    In addition, I have another question. All my listings in gd_job are without STREET ADDRESS, so all are located in the center of the cities. So is not important display the map…
    QUESTION 2
    How can I hide Map only from one specific post type (for example gd_job)?
    Id like hide map from POST TYPE PAGE:
    http://infocity.website/ofertasdetrabajo/
    and from SEARCH POST TYPE PAGES:
    like example this following page
    http://infocity.website/?geodir_search=1&stype=gd_job&s=+&snear=figueres&sgeo_lat=42.26550659999999&sgeo_lon=2.9581046000000697
    I think I can add a special code in the field “conditional widget” into the “GMap Listing Page” in order to hide it from special gd_job
    Thanks for your support.

    #289605

    Guust
    Moderator
    Post count: 29970

    1. Street address is mandatory for all listings with an address and a map, but it does not matter what you enter there, for example, you can just enter the name of the business.

    2. You can turn off the requirement for maps and addresses at GD > General > general tab > Select CPT to disable physical location

    #289779

    giuseppe cuttone
    Buyer
    Post count: 242

    Hi Guust,
    first, thaks for your support.
    Question 1: OK
    Question 2: maybe I have explained wrong.
    All my listing in all my post types are with address, so I dont want disable physical location. I know this option, but I dont need that.
    I have several posts types. In the each listing page, of each post type, is displayed the map because I have introduced “GMAP LISTING PAGE” in the following “widget area”:
    “GD LISTING TOP SECTION”
    But in one page of them, concretely in my “gd_job” post type, I dont want displayed the map.
    In order to do that, I think I can use “widget logic” plugin. I know the following code:
    geodir_get_current_posttype()==’gd_job’
    If I introduce it in GMAP WIDGET into “Coditional widget field”, map will be showed only in the listing pages of the post type “gd_job”, and in the other listings pages it will be not shown.
    But I need to do exactly the opposite… dont show this widget (GdMap) in listing page of “gd_job”, and show map in the others listing pages.
    I have tried to use the sub code “!is_”, but it dont run…
    So I ask to GD team how is possible to show the map in all listing post type, but no in “gd_job”.
    I hope your answer.
    Thanks for your support.

    #289922

    Guust
    Moderator
    Post count: 29970

    Use this:

    geodir_get_current_posttype()!=='gd_job'

    Put a question mark before the equal sign, and let us know if that worked.

    Thanks.

    #289979

    giuseppe cuttone
    Buyer
    Post count: 242

    yes, it runs very well. Thanks.
    Now, I have detected a small problem…
    Users can create listings without put street address (but introducing the country, region and city). All the listings without street address will be located in the center of the city, but when I click in the icon (into the map) located in the center of the city only the first listing published will be displayed in the “small box”, and the others will not be displayed. I think it is an error. Do you will solve that?
    Thanks very very much for your support.

    #289980

    Guust
    Moderator
    Post count: 29970

    All the listings are there, but because they all have exactly the same lat and lng [being the city center] they are all on top of each other. The only way to solve that is to drag the markers a little bit, so they do not have the same lat and lng anymore.

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount