ManagerJosh
Well-known member
What's the proper way of calling about a select number of custom thread fields on showthread (still learning template names) and what's the performance impact generally?
If you're viewing a thread, the thread field values for that thread are already available in$thread.custom_fields
. Essentially no overhead.
I believe the information should generally be available there as well without significant overhead. The main detection would probably be by looking at the queries run on a page -- if you start seeing a similar query running over and over, then that would indicate that data is only being loaded on demand.
custom_field_1
custom_field_3
custom_field 2
You'd need to call each value individually ($thread.customer_fields.custom_field_1
) wherever you want it to display.
<xf:macro template="custom_fields_macros" name="custom_fields_view"
arg-type="threads"
arg-group="before"
arg-onlyInclude="{$thread.Forum.field_cache}"
arg-set="{$thread.custom_fields.custom_field_1}"
arg-wrapperClass="message-fields message-fields--before" />
$thread.custom_fields
. If you want to filter that to multiple fields you can change the onlyInclude argument (provided the format matches the field cache).Hi @Mike, @Chris D . I am using $thread.customer_fields.custom_field_1 to display customer field. Its only work if I used text box Field type. If I used Radio buttons, Drop down selection , Multiple-choice drop down ... its just display Value ( value_a_z_0_9_and_only). I like to display Text. How can I do that? please helpOh, you're using the macro which is for multiple fields. You need to pass it a set of custom fields then, so$thread.custom_fields
. If you want to filter that to multiple fields you can change the onlyInclude argument (provided the format matches the field cache).
How did you do it?its here, if you still need it
{$thread.custom_fields.getFormattedValue('fieldID')}
div class="structItem-minor">
<ul class="structItem-parts">
<xf:if is="{$thread.custom_fields.getFormattedValue('fieldID')}">
<li>Tipo de chollo: {$thread.custom_fields.getFormattedValue('fieldID')}</li>
</xf:if>
</ul>
</div>
<div class="structItem-minor">
<ul class="structItem-parts">
<xf:if is="$thread.custom_fields.tipos_chollos">
<li>{$thread.custom_fields.getFormattedValue('tipos_chollos')|raw}</li>
</xf:if>
</ul>
</div>
We use essential cookies to make this site work, and optional cookies to enhance your experience.