Combine code for primaryEmail and email into a macro
This commit is contained in:
parent
06a2b67f57
commit
451556e589
1 changed files with 22 additions and 30 deletions
|
@ -3,36 +3,10 @@
|
|||
<#-- Contact info on individual profile page -->
|
||||
|
||||
<#-- Primary Email -->
|
||||
<#assign primaryEmail = propertyGroups.getPropertyAndRemoveFromList("${core}primaryEmail")!>
|
||||
<#if primaryEmail?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
||||
<@p.addLinkWithLabel primaryEmail editable />
|
||||
<#if primaryEmail.statements?has_content> <#-- if there are any statements -->
|
||||
<ul id="primary-email" class="individual-emails" role="list">
|
||||
<#list primaryEmail.statements as statement>
|
||||
<li role="listitem">
|
||||
<img class ="icon-email middle" src="${urls.images}/individual/emailIcon.gif" alt="email icon" /><a class="email" href="mailto:${statement.value}">${statement.value}</a>
|
||||
<@p.editingLinks "${primaryEmail.localName}" statement editable />
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
</#if>
|
||||
<@emailLinks "${core}primaryEmail" "primary-email" />
|
||||
|
||||
<#-- Additional Emails -->
|
||||
<#assign email = propertyGroups.getPropertyAndRemoveFromList("${core}email")!>
|
||||
<#if email?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
||||
<@p.addLinkWithLabel email editable />
|
||||
<#if email.statements?has_content> <#-- if there are any statements -->
|
||||
<ul id="additional-emails" class="individual-emails" role="list">
|
||||
<#list email.statements as statement>
|
||||
<li role="listitem">
|
||||
<img class ="icon-email middle" src="${urls.images}/individual/emailIcon.gif" alt="email icon" /><a class="email" href="mailto:${statement.value}">${statement.value}</a>
|
||||
<@p.editingLinks "${email.localName}" statement editable />
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
</#if>
|
||||
<#-- Additional Emails -->
|
||||
<@emailLinks "${core}email" "additional-emails" />
|
||||
|
||||
<#-- Phone -->
|
||||
<#assign phone = propertyGroups.getPropertyAndRemoveFromList("${core}phoneNumber")!>
|
||||
|
@ -48,4 +22,22 @@
|
|||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<#macro emailLinks property listId>
|
||||
<#assign email = propertyGroups.getPropertyAndRemoveFromList(property)!>
|
||||
<#if email?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
||||
<@p.addLinkWithLabel email editable />
|
||||
<#if email.statements?has_content> <#-- if there are any statements -->
|
||||
<ul id="${listId}" class="individual-emails" role="list">
|
||||
<#list email.statements as statement>
|
||||
<li role="listitem">
|
||||
<img class ="icon-email middle" src="${urls.images}/individual/emailIcon.gif" alt="email icon" />
|
||||
<a class="email" href="mailto:${statement.value}">${statement.value}</a>
|
||||
<@p.editingLinks "${email.localName}" statement editable />
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
</#if>
|
||||
</#macro>
|
Loading…
Add table
Add a link
Reference in a new issue