Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi All,
using Simple address module, I would like to modify the order of fields, when they are displayed on the web page.
The address is currently displayed as follow :
<div property="schema:location" class="field field--name-field-adresse field--type-simpleaddress field--label-hidden field__item">
<div class="addressfield">
<div itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">27 Avenue François Mitterrand</span>
<span itemprop="addressLocality">Créteil</span>
<span itemprop="addressRegion"></span>
<span itemprop="postOfficeBoxNumber"></span>
<span itemprop="postalCode">94000</span>
<span itemprop="addressCountry">France</span>
</div>
</div>
</div>
I would prefer :
<div property="schema:location" class="field field--name-field-adresse field--type-simpleaddress field--label-hidden field__item">
<div class="addressfield">
<div itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">27 Avenue François Mitterrand</span>
<span itemprop="postalCode">94000</span>
<span itemprop="addressLocality">Créteil</span>
<span itemprop="addressRegion"></span>
<span itemprop="postOfficeBoxNumber"></span>
<span itemprop="addressCountry">France</span>
</div>
</div>
</div>
How can I do ?
Thanks for your help.
Cheers
Comment | File | Size | Author |
---|---|---|---|
#3 | SimpleAddressDefaultFormatter.php_.txt | 3.45 KB | fred@familleloup.com |
Comments
Comment #2
fred@familleloup.com CreditAttribution: fred@familleloup.com commentedComment #3
fred@familleloup.com CreditAttribution: fred@familleloup.com commentedI succéder in doing this. I modified the SimpleAddressDefaultFormatter.php file.
I created the individual variables and concanate them in the desired order.
My version attached (PHP file with extension.
Cheers
Comment #4
fred@familleloup.com CreditAttribution: fred@familleloup.com commented