Different custom fields for different maps on same site?

New home Forums Pro Add-on General queries Different custom fields for different maps on same site?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #73348
    Kyky716
    Participant

    Hello, I have the pro add on.

    I need assistance figuring out how to apply multiple maps with different custom fields on my website. I already have multiple maps integrated, but they are for different purposes and need different customer fields. For example, one map may need to have “website, location, price” for each marker, and on another page the map will need to have “location, types of products sold, contact info” Is there a way to achieve this? I have the ACF plugin but cant seem to figure out how to get it to work with this.

    To be clear, I’m aware I can create categories and have the ability to filter by category, but I need the custom fields for each one to be different, and I need each map on a separate page. Any help in figuring this out would be greatly appreciated.

    Thank you.

    #73353
    Matthew
    Moderator

    Hi there,

    Thank you for getting in touch with us, we do appreciate your time.

    Currently, our ACF integration currently only displays the post’s/page’s title and link, thus the best way to achieve this would be to manually create the markers in your maps and set their “link” field to the respective post/page.

    Alternatively, you may also import your ACF markers using the Import feature (Maps -> Advanced), however, please note that this will import all your ACF markers to a single map, thus the above method of creating each of your markers may be the better option as you can create the markers in each map as needed.

    Once you have your markers created in your maps, you may then create your respective custom fields on the Custom Fields page (Maps -> Custom Fields), which will then create custom fields when creating/editing markers so that you may enter custom values.

    Should you like more information on the Custom Fields feature, please see our documentation here: https://www.wpgmaps.com/custom-fields/

    Please do let me know if this answers your question?

    Kindest Regards,
    Matthew

    #73366
    Kyky716
    Participant

    Thanks for your reply. Unfortunately, this doesn’t really help.

    I don’t need to link to any posts, I only need different custom fields for different maps. Is there a way to do this by creating multiple different instances of WP Google Maps on my WP site? Having each marker simply link to a post or page without displaying any custom fields doesn’t help me with anything, and I’m looking for all the information to be displayed in the attached table under my map.

    This could also be achieved by creating all the custom fields I need at once, and having the ability to “hide” certain ones on certain pages to fit my needs.

    Is there any way at all to achieve this, though ACF or otherwise? Any way to edit the code to make this happen?

    Thank you for your time.

    • This reply was modified 1 month, 3 weeks ago by Kyky716.
    #73570
    Matthew
    Moderator

    Hi again,

    Thank you for your response and time on this, I really appreciate it!

    Thank you for the elaboration, the custom fields will only display in the marker listing/infowindow if it has a value entered in the marker on the map, however, the “Advanced Table” marker listing style is the only style that includes the column for the custom field.

    Should you be referring to using this styling, you may use custom CSS to hide the unused columns whereby you target the page/post ID and then the column. Please do let me know if you need assistance with this and if so, please may you provide me with the links to your pages and the respective columns you want to hide?

    I hope this answers your question?
    Kindest Regards,
    Matthew

    #73584
    Kyky716
    Participant

    Thanks Matthew for your help, truly.

    I am in fact using the advanced table option as this is what I need to use for my purposes. In terms of being able to hide specific columns using custom CSS, I’m not sure on how to do this.

    If I’m understanding you correctly, I would need to create all of the customer fields I want to use throughout all my tables, and then use custom CSS to hide targeted columns on specific pages, is that correct?

    If so, I may need assistant with this problem. I do not yet have the tables completely set up with their respective fields, but I can do this rather quickly if you require it to help me. However, I’d like to ability to change things around in the future, so would it be possible to give me an example custom CSS code that could do this for a targeted table?

    I hope this makes sense. Thanks again for all your help and I’m looking forward to hearing your response. Let me know what information you need from me as well.

    Thanks

    #73594
    Matthew
    Moderator

    Hi there,

    Thank you for the confirmation, thus yes that is correct, you would need to use custom CSS to target specific custom fields that you want hidden on specific pages.

    I am more than happy to assist you with writing the code, thus please see my recorded video of how to write the needed custom CSS code for this here: https://drive.google.com/file/d/1jxxB6BbRX5er8hkbomPQeKWPG4Yt8iRy/view?usp=sharing

    The final code in the above video is as follows:

    /* Target the page/post ID first, then target the column you want to hide */
    .page-id-18 .wpgmza_table_custom_field_2 {
        display: none;
    }

    Please do let me know if this helps?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

    #73598
    Kyky716
    Participant

    Matthew, this works well on desktop and is exactly what I needed! Thank you!
    I have noticed however that it doesn’t work so well on mobile. Using the advanced table, if there are too many custom fields then there is a green “+” displayed to view the rest of the fields not shown. Any fields I’ve hidden using this still show up here. I can get around this by moving the hidden custom fields to the “top” of the custom fields list, but this makes it so that the table doesn’t display anything in that column.

    Is there any way to get around this?

    Thanks again for all your help!

    #73612
    Matthew
    Moderator

    Hi again,

    I am happy to hear that the custom code works well.

    With regards to the mobile view, this is caused due to the custom field rows will have a different class selector as it is placed in a child row, thus similarly how I found the class selector as seen in the video, you can do the same to find the class of the custom field row in the child row.

    Should you need assistance with this, please may you provide me with the link to you map so that I may take a closer look?

    Please do let me know if this helps?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.