Related Contents

Unmaintained Related Contents 1.5.2

No permission to download
How to create new custom templates:
(custom_content_type is name of your custom content type.)

- Create a new template for your custom content type - related_content_custom_content_type. (You can copy your custom_content_type search result template)

- Then open related_content_results template and add your custom content type. You propably need to map/set some variables to the custom template. $result.content is your custom content type data array.

Code:
<xen:elseif is="{$result.0} == 'custom_content_type'" />
<xen:include template="related_content_custom_content_type">
<xen:map from="$result.content" to="$custom_content_type" />
</xen:include>

It should look like this:

HTML:
<xen:if is="{$relatedContentResults}">
<xen:require css="search_results.css" />
<div class="{xen:if '!{$xenOptions.enableWidgetFramework}','section sectionMain ',''}searchResults">
    <ol class="searchResultsList">
        <xen:foreach loop="$relatedContentResults" value="$result">
                <xen:if is="{$result.0} == 'thread'">
                    <xen:include template="related_content_thread">
                        <xen:map from="$result.content" to="$thread" />
                        <xen:set var="$forum" value="{xen:array 'node_id={$result.content.node_id}','title={$result.content.node_title}','node_name={$result.content.node_name}'}" />
                        <xen:map from="$result.content" to="$post" />
                    </xen:include>
                <xen:elseif is="{$result.0} == 'xengallery_media'" />
                    <xen:include template="related_content_xengallery_media">
                        <xen:map from="$result.content" to="$item" />
                        <xen:set var="$search" value="{xen:array 'search_query=""'}" />
                    </xen:include>
                <xen:elseif is="{$result.0} == 'resource'" />
                    <xen:include template="related_content_resource">
                        <xen:map from="$result.content" to="$resource" />
                    </xen:include>                                         
                <xen:elseif is="{$result.0} == 'showcase_item'" />
                    <xen:include template="related_content_showcase_item">
                        <xen:map from="$result.content" to="$item" />
                    </xen:include> 
                <xen:elseif is="{$result.0} == 'custom_content_type'" />
                    <xen:include template="related_content_custom_content_type">
                        <xen:map from="$result.content" to="$custom_content_type" />
                    </xen:include>
              </xen:if>
        </xen:foreach>
    </ol>
</div>
</xen:if>
Top