@Sim Thank you I appreciate you taking the time to respond.
I made it a little harder than it needed to be but I think I have the basic set-up now. I created two new templates, one for the tab name/heading and one for the tab contents, and used template include in member_view in the locations you mentioned.
Here's an except of new_template_member_view_tabs_content
Code:
<li id="writingstuff" class="profileContent">
<xen:if hascontent="true">
<div class="section">
<h3 class="textHeading">What do you write?</h3>
<div class="primaryContent">
<xen:contentcheck>
<div class="pairsColumns aboutPairs">
<dl><xen:if is="{$user.customFields.writing_genre}"><dt><b>{xen:helper userFieldTitle, writing_genre}: </b></dt> <dd>{xen:helper userFieldValue, $userFieldsInfo.writing_genre, $user, {$user.customFields.writing_genre}}</dd></xen:if>
<br></br>
<dl><xen:if is="{$user.customFields.writing_type}"><dt><b>{xen:helper userFieldTitle, writing_type}: </b></dt> <dd>{xen:helper userFieldValue, $userFieldsInfo.writing_type, $user, {$user.customFields.writing_type}}</dd></xen:if>
<br></br>
<dl><xen:if is="{$user.customFields.writing_experience}"><dt><b>{xen:helper userFieldTitle, writing_experience}: </b></dt> <dd>{xen:helper userFieldValue, $userFieldsInfo.writing_experience, $user, {$user.customFields.writing_experience}}</dd></xen:if>
<br></br>
</div>
</xen:contentcheck>
</div>
</div>
If I may, I have a few questions:
- Does my usage above in the in the <dl><dt> (conditionals helper, custom field references) look correct? I was able to do it by finding a post on Xenforo.com from 2010 or 2011 so I'm concerned it may be outdated.
- What is <xen:contentcheck>?
- You mentioned I needed to use an extention to XenForo_ControllerPublic_Member class to provide a controller action to generate content to display. I don't believe I've done this, could you explain a little further on how it is and how it works?
I've managed to get the custom fields and custom tabs to display basically how I want them. I'd like to take it a step further, however, and display a tab that lists resource items by the user who's profile we're viewing from a specific resource category.
You ever mess around with code for seven hours when you have no idea what you're doing? That was me last night. I tried everything I could find. I tried copying and manipulating code from various resource list templates. I tried conditional statements. Though I don't understand how they work, I tried foreach looks for resource categories and resource items. I tried using CSS classes to reference a particular resource category. I even tried search strings, which is very hackish. No luck.
I scoured the Xenforo forum but there's only about three references to resource category conditionals/filters on the site, and all were unclear if doing what I wanted was achievable through the routes attempted.
As of now, I have the following included in the template, which has provided me with a duplicate list of resources by the author (the same as the existing resource tab):
Code:
<li id="resources" class="profileContent" data-loadUrl="{xen:link resources/authors, $user, 'profile=1'}"
style="display:list-item;"></li>
I'm not sure if this conditional reference is correct, but I think I essentially need to include the following within the data-loadUrl or within a foreach loop:
Code:
<xen:if is="{$category.resource_category_id} == 113"></xen:if>
Based on my examination of the code and other uses, I don't think I can filter the data-loadUrl and I most likely need to create a new foreach loop. To create a foreach loop to display resources from a specific category by the user who's profile you're on, I guessing I will need to create a new php file/Listener file? Am I on the right track?