• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Custom User Fields (1.1) - A few questions

Andrej

Well-known member
#1
  1. Is it possible to put a separator between "Home Page" and "Username", where the "Username" is a custom user field?
  2. Is it possible to move the custom user field field(s) to a new page, f. ex. called "Other Details"? I want a few (not all) of them to show on a separate page, than on Personal Details, Contact Details or Preferences pages.
  3. Almost same as 1, just in the Information tab instead?
  4. And the last question, what do I need to do to make a custom user field (only the ones I want to show there) to show on the custom tab(s) I make?
17-10-2011 18-20-13.png 17-10-2011 18-23-37.png 17-10-2011 18-28-33.png 17-10-2011 18-28-33.png 17-10-2011 18-34-06.png
I have poked around in templates, but I just messed it all up and have not found a good way to archive 1 and 2. Hope someone can guide me. Thanks in advance. :)
 

Jake Bunce

XenForo moderator
Staff member
#2
1) Edit this template:

Admin CP -> Appearance -> Templates -> account_personal_details

Add the red code:

Code:
	<xen:hook name="account_personal_details_information">
	<fieldset>
		<dl class="ctrlUnit">
			<dt><label for="ctrl_location">{xen:phrase location}:</label></dt>
			<dd><input type="text" name="location" value="{$visitor.location}" id="ctrl_location" class="textCtrl OptOut" /></dd>
		</dl>

		<dl class="ctrlUnit">
			<dt><label for="ctrl_occupation">{xen:phrase occupation}:</label></dt>
			<dd><input type="text" name="occupation" value="{$visitor.occupation}" id="ctrl_occupation" class="textCtrl OptOut" /></dd>
		</dl>

		<dl class="ctrlUnit">
			<dt><label for="ctrl_homepage">{xen:phrase home_page}:</label></dt>
			<dd><input type="url" name="homepage" value="{$visitor.homepage}" id="ctrl_homepage" class="textCtrl" /></dd>
		</dl>
	</fieldset>
	<fieldset>
		<xen:include template="custom_fields_edit" />
	</fieldset>
	</xen:hook>
2) There is no configurable option for that. An addon is required.

3) Edit this template:

Admin CP -> Appearance -> Templates -> member_view

Remove the red code, add the blue code:

Code:
			<li id="info" class="profileContent">
				<xen:if is="{$user.signature}">
					<div class="section">
						<h3 class="textHeading">{xen:phrase signature}</h3>
						<div class="primaryContent">
							<div class="baseHtml signature ugc">{xen:raw $user.signatureHtml}</div>
						</div>
					</div>
				</xen:if>

				<xen:if hascontent="true">
					<div class="section">
						<h3 class="textHeading">{xen:phrase about}</h3>

						<div class="secondaryContent">
							<xen:contentcheck>
								<xen:if hascontent="true">
									<div class="pairsColumns aboutPairs">
									<xen:contentcheck>
										<xen:if is="{$user.gender}">
											<dl><dt>{xen:phrase gender}:</dt> <dd><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd></dl>
										</xen:if>

										<xen:if is="{$birthday}">
											<dl><dt>{xen:phrase birthday}:</dt> <dd>{xen:date $birthday.timeStamp, $birthday.format} <xen:if is="{$birthday.age}">({xen:phrase age}: {xen:number $birthday.age})</xen:if></dd></dl>
										</xen:if>

										<xen:if is="{$user.homepage}">
											<dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage, 'x'}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
										</xen:if>

										<xen:if is="{$user.location}">
											<dl><dt>{xen:phrase location}:</dt> <dd>{xen:string censor, $user.location}</dd></dl>
										</xen:if>

										<xen:if is="{$user.occupation}">
											<dl><dt>{xen:phrase occupation}:</dt> <dd>{xen:string censor, $user.occupation}</dd></dl>
										</xen:if>
										
										<xen:if is="{$customFieldsGrouped.personal}">
											<xen:foreach loop="$customFieldsGrouped.personal" value="$field">
												<xen:include template="custom_field_view" />
											</xen:foreach>
										</xen:if>
									</xen:contentcheck>
									</div>
								</xen:if>

								<xen:if is="{$user.about}"><div class="baseHtml ugc">{xen:raw $user.aboutHtml}</div></xen:if>
							</xen:contentcheck>
						</div>
					</div>
				</xen:if>

				<div class="section">
					<h3 class="textHeading">{xen:phrase interact}</h3>

					<div class="primaryContent">
						<div class="pairsColumns contactInfo">
							<dl>
								<dt>{xen:phrase content}:</dt>
								<dd><ul>
									<xen:hook name="member_view_search_content_types">
									<li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
									<li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
									</xen:hook>
								</ul></dd>
							</dl>
							<xen:if is="{$canStartConversation}">
								<dl><dt>{xen:phrase conversation}:</dt> <dd><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></dd></dl>
							</xen:if>
							<xen:if is="{$customFieldsGrouped.contact}">
								<xen:foreach loop="$customFieldsGrouped.contact" value="$field">
									<xen:include template="custom_field_view" />
								</xen:foreach>
							</xen:if>
						</div>
					</div>
				</div>

				<div class="section">
					<h3 class="textHeading">Game Details</h3>

					<div class="primaryContent">
						<div class="pairsColumns aboutPairs">
							<xen:if is="{$customFieldsGrouped.personal}">
								<xen:foreach loop="$customFieldsGrouped.personal" value="$field">
									<xen:include template="custom_field_view" />
								</xen:foreach>
							</xen:if>
						</div>
					</div>
				</div>
			</li>
4) Custom tabs where?
 

Fuhrmann

Well-known member
#6

Andrej

Well-known member
#7