This topic contains 7 replies, has 4 voices, and was last updated by  Konstantin 1 month, 1 week ago.

Add line break in address infobox

  • User Level

    Hi I would like to change the way the address is displayed in the info box underneath the map so it reads:

    Store 1

    Test street 1
    324237 Testville

    I know how to change the default order of the address but I do not not have sufficient php knowledge to break the address over two lines.

    The following code located in ssf-wp-xml.php needs to break after ssh_wp_address

    echo '<address>' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)) .$addr2.ssfParseToXML($row['ssf_wp_zip']). ' ' .ssfParseToXML(__($city,SSF_WP_TEXT_DOMAIN)). ' ' .ssfParseToXML(__($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'</address>';

    Alex
    StaffUser Level

    Hi there,

    Thank you for your inquiry, you can try to use code (edit ssf-wp-xml.php) below to add a break line in address infobox:

    * Click the image for larger view

    address_spacing

    • This reply was modified 4 years, 9 months ago by Alex Alex.
    • This reply was modified 4 years, 3 months ago by Alex Alex.
    • This reply was modified 4 years, 3 months ago by Alex Alex.
    • This reply was modified 4 years, 3 months ago by Alex Alex.
    User Level

    The code doesn’t work.
    Would be nice to get the correct solution.
    I also need it like glenngtr, because it is the right format in Germany

    Store 1

    Street 10
    12345 City
    State

    I changed the code to this, but there is no break in it..
    echo '<address>' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)) . ' ' .ssfParseToXML($row['ssf_wp_zip']) .$addr2.ssfParseToXML(__($city,SSF_WP_TEXT_DOMAIN)). ' ' .ssfParseToXML(__($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'</address>';

    Thank you

    Alex
    StaffUser Level

    Hi there,

    The break line should be html encoded, we’ve updated the screenshot in previous post.

    Cheers,
    Alex

    User Level

    I change to

    echo '<address>' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)). '<br />' .ssfParseToXML($row['ssf_wp_zip']). '' .ssfParseToXML(_($row['ssf_wp_city'],SSF_WP_TEXT_DOMAIN)). '<br />' .ssfParseToXML(_($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'</address>';

    but not working, has something changed?

    User Level

    Hi Konstantin,

    By coincidence I worked on my site yesterday and had to redo the code. I got a notification from your reply as I created the threat. This code worked for me:

    echo '
    ' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)).'<br>' .ssfParseToXML($row['ssf_wp_zip']). ' '.ssfParseToXML(__($row['ssf_wp_city'],SSF_WP_TEXT_DOMAIN)).'<br>' .ssfParseToXML(__($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'
    ';

    Hope it helps!

    User Level

    I forgot to add the address tags. This is the complete code. Replace it on line 139

    echo '<address>' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)).'<br>' .ssfParseToXML($row['ssf_wp_zip']). ' '.ssfParseToXML(__($row['ssf_wp_city'],SSF_WP_TEXT_DOMAIN)).'<br>' .ssfParseToXML(__($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'</address>';

    User Level

    Thank your..
    This code Working:

    echo '<address>' .ssfParseToXML(__($row['ssf_wp_address'],SSF_WP_TEXT_DOMAIN)). '<br />' .ssfParseToXML($row['ssf_wp_zip']). ' '.ssfParseToXML(__($row['ssf_wp_city'],SSF_WP_TEXT_DOMAIN)). '<br />' .ssfParseToXML(__($row['ssf_wp_state'],SSF_WP_TEXT_DOMAIN)).'</address>';

You must be logged in to reply to this topic.