MashUp: Shortcodes in Post-Excerpt

Home Forums MapPress Support MashUp: Shortcodes in Post-Excerpt

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #18752
    Avantart
    Participant

    Hi Chris!

    I am working on a mashup where the WP-Theme and Pagebuilder is DIVI.
    The POIs in that mashup are retrieved from automatic maps where the geocoding field = Adress line 1 = custom field “projektadresse”

    This all works well.

    The POI Content ist set to “<label><input checked=”checked” name=”mappress_options[mashupBody]” type=”radio” value=”poi” />POI title + POI body”</label>
    I want the “Post title” as POI-Title and the geocoding field / custom field “projektadresse” as POI-Body

    The alternative option “POST title + POST excerpt” is unusable, because DIVI loads a big bunch of short-codes into the postbody and post excerpt:
    Screenshot
    How should I define the map popup template?
    this is not working:

    <div class=’mapp-title’>{{{post.title}}}</div>
    <div class=’mapp-body’>{{poi.props.projektadresse}}</div>

    #18753
    Chris
    Keymaster

    Hi,

    The way you have the template looks right, the plugin should pick up the projektaddresse custom field.

    But did you edit the ‘map popup’ or the ‘mashup popup’? Since it’s a mashup, you need to put that code in the ‘mashup popup’ template.

    #18759
    Avantart
    Participant

    Dear Chris, I think I was not clear enough.

    This is the Mashup: https://www.vorpommersche-kueste.de/aktuelle-projekte-3-2/
    it works well

    I looked into the template for map-popup, but the template for mashup-popup brings this result, see screenshot:

    POI Title + POI Excerpt
    You see this does not show relevant information

    I need the posttitle in the title and the adress in the body.

    This picture shows the content of the PopUp in the MashUp when “PostTitle + PostExcerpt” is defined in the settings
    Posttitle + PostExcerpt

    My whish is instead of getting all these DIVI-shortcodes in the mapp-body and the adress in the mapp-title:

    In the mapp-title the Post-Title

    mapp-title = custom field ‘projektadresse’

    I tried this code:

    <div class=’mapp-title’>{{{post.title}}}</div>
    <div class=’mapp-body’>
    {{{poi.thumbnail}}}
    {{poi.props.projektadresse}}
    </div>
    <div class=’mapp-links’><?php _e(‘Directions’, ‘mappress-google-maps-for-wordpress’); ?><div>

    How to create the code for the mashup-popup?

    Thanks for your help, Connie

    #18760
    Chris
    Keymaster

    Hi,

    I see the mashup here:
    https://www.vorpommersche-kueste.de/aktuelle-projekte-3-2/

    Your code for the mashup popup looks OK. But at the URL above, it doesn’t look like the mashup popup template has been modified. Could you save the template so I can see the result on the mashup map?

    #18770
    Avantart
    Participant

    Hi Chris,

    the MashUp is working with the setting “POI Title + POI Body”
    It is triggered by this shortcode:

    [mashup query="meta_key=projektadresse&posts_per_page=-1"]

    and  uses the standard Mashup-PopUp-Template
    ===================
    <div class=’mapp-title’>{{{poi.title}}}</div>
    <div class=’mapp-body’>
    {{{poi.thumbnail}}}
    {{{poi.body}}}
    </div>
    <div class=’mapp-links’><?php _e(‘Directions’, ‘mappress-google-maps-for-wordpress’); ?><div>
    ===================
    I reverted POI-content-setting to the standard “POI-Title + POI body”, but the result is not what I really need.

    When I change the POI-content-setting to “Post Title + Post Body” I get the postbody with all the DIVI-shortcodes and no readable content (see screenshot above)

    That is why I am asking how to define the template to get this result:
    the mapp-title => PostTitle
    the mapp-body => custom field “projectadresse”

    and whether I have to change the setting “POI content” with a template like this.

    Please tell me the correct code for the mapp-body as I don’t understand the syntax in the documentation

    <div class=’mapp-body’>
    {{{poi.thumbnail}}}
    {{{  “CUSTOM FIELD PROJECTADRESSE ” }}}
    </div>

    Cheers, Connie

    #18771
    Chris
    Keymaster

    Hi,

    To get what you want you’ll need to make the mashup setting “Post title and excerpt”. Then, enter the code you originally posted into the mashup-popup template:

    <div class='mapp-title'>{{{post.title}}}</div>
    <div class='mapp-body'>{{poi.props.projektadresse}}</div>

    I think I see the problem: when I pasted in your code, it contained curly quotes ( ’ ) instead of straight quotes ( ‘ ). Only straight quotes are allowed for HTML attributes. If you use the version above, it should work.

    If that doesn’t help, please create the template as shown above and then *leave it active* so I can see it in the mashup (or send a login to the site for that purpose).

    #18772
    Avantart
    Participant

    I did what you suggested, but now the POIs don’t pop up

    I reverted to the original status and send you an email

     

    Cheers, Connie

    #18773
    Chris
    Keymaster

    Hi Connie,

    Thanks, being able to see the map was a big help, and I think it’s working now.

    I found two issues:

    1. For the title, it’s ‘poi.title’ not ‘post.title’
    2. The plugin uses the default template when viewing a mashup in the admin. But for some reason, you site was setting the admin flag even when viewing the mashup on the frontend.

    For #2, I removed the admin check in the copy of MapPress that is on your site. I’ll also include that change in the next release.

    #18774
    Avantart
    Participant

    Dear Chris, thank you!

    This is what I wanted to acchieve!

    Well, you correct that post.title should be set instead of poi.title.  This was set because I had to reset the map to the “old behaviour” until the final version was finished.

    Thank you, now can tell the users that the map is showing the desired content,

    another plus for MapPress Pro!

    Connie

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