• Resolved mshea28

    (@mshea28)


    Hi there! I’m relatively new to OUM, and am trying to set up my site so that when new locations are added to my map, a new page is created and automatically populated with information about the location. From reading prior forums, I understand this involves changing the page template — but I haven’t been able to figure out how to do that with my theme (GeneratePress) and Elementor (I’m a total php novice, so would like to avoid that route). Any advice you can give on how to do this would be greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author 100plugins

    (@100plugins)

    Hi @mshea28,

    the workflow on how to add a single view template for a custom post type is different for any theme and page builder.

    Variant 1 (involves PHP):
    I’ve found a little documentation for the GeneratePress theme: https://docs.generatepress.com/article/setting-up-a-simple-custom-post-type/

    Variant 2:
    You can use Elementor to build the template. Here is the tutorial: https://elementor.com/blog/design-your-single-post-template/
    To render location information inside the template just use shortcodes [open-user-map-location value=”Favorite color”] as described in the plugin’s Help section under Additional Shortcodes. You would need to have the PRO version to do this.

    Best Regards,
    Daniel

    Thread Starter mshea28

    (@mshea28)

    Thanks so much for all of this helpful info! I’ve been working on doing this using Elementor PRO, but there are a few things I’m not understanding about how OUM Locations interfaces with WordPress post infrastructure.

    A test version of my map, with a single location, is up and running here: https://edna.meghanmshea.su.domains/explore-map/

    Using the shortcodes, I’ve made an Elementor template so that when visitors click “Read more,” they go to a page that is pre-populated with information about the location. First question this raises: is there any easy way to make this template responsive to whether or not there is actually information in a given custom field? For example, I use “More Information: [open-user-map-location value=”Longer Project Description”]” in the template, but for some projects (like the current test project), the “Longer Project Description” field is blank. It would be great if there were an easy way to remove that line entirely if there was no text returned by the shortcode, but as a WordPress/Elementor neophyte, I have no idea if that’s possible.

    Second question: I’m hoping to also display these posts in a grid below the map, where viewers can filter by marker category. Right now, my posts don’t have official WordPress “featured images” or “excerpts,” which would be nice to have show up in the post boxes here. Is there a way to automatically set the image uploaded to the location as the “featured image” and the short description added as the “excerpt”?

    • This reply was modified 3 years, 1 month ago by mshea28.
    Plugin Author 100plugins

    (@100plugins)

    Hi @mshea28,

    Btw meanwhile I published an article in the OUM Knowledge Base on how to handle single page templates. But it basically consists the information I gave you before.

    Regarding your first question I think what you are trying to achieve is only possible with PHP (not with the shortcode). Basically you would need to check if the PHP function returns something before rendering the label and the returned value. I think this is not possible with Elementor.

    Regarding your second question: Right now this is on purpose. My thought was to protect the media library (which would be necessary to set a featured image) from image spam. But this is maybe not the best approach and I will dive into this more deeply. I’ll let you know if and when this will be possible.

    Best Regards,
    Daniel

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding content to single pages for location’ is closed to new replies.