Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Office Hours in Profile
// Your profile type editor should include custom fields similar to this
Monday Office Hours -> text (one line)
ID: profiles_4
Tuesday Office Hours -> text (one line)
ID: profiles_5
Wednesday Office Hours -> text (one line)
ID: profiles_6
Thursday Office Hours -> text (one line)
ID: profiles_7
Friday Office Hours -> text (one line)
ID: profiles_8
// Below assumes a Profile Type with fields set up as above.
// Profile IDs will need to be adjusted based on actual field IDs.
// Place this code in profiles.php where you want the table to appear.
<xphp content="true" ifmode="or">
<if var="profiles_4"/>
<if var="profiles_5"/>
<if var="profiles_6"/>
<if var="profiles_7"/>
<if var="profiles_8"/>
<content>
<div class="office-hours">
<table>
<caption>Office Hours</caption>
<thead>
<tr>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
</tr>
</thead>
<tr>
<td><xphp var="profiles_4" inner="true" /></td>
<td><xphp var="profiles_5" inner="true" /></td>
<td><xphp var="profiles_6" inner="true" /></td>
<td><xphp var="profiles_7" inner="true" /></td>
<td><xphp var="profiles_8" inner="true" /></td>
</tr>
</table>
</div>
</content>
</xphp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment