Related Contents

Unmaintained Related Contents 1.5.2

No permission to download
- Fixed a bug: The first post message was not showing.
  • Like
Reactions: THLove
- Reduced the number of queries, improved cache.
- Widget Framework Ready. Admin Cp -> Content Tagging -> Enable Widget Framework. Note: You must have Widget Framework installed and the widget (Related Contens: Thread View) should be used on thread_view only.
- Added the ability to Clean Up cache manually: Tools > Rebuild Caches -> "Related Contents: Clean Up Cache"
- From this version, you can customize/style the Related Contents container by editing these templates:
related_content_results -> main container template
related_content_thread -> single thread item template
related_content_xengallery_media -> single media item template
related_content_showcase_item -> single showcase item template
related_content_resource -> single resource item template

If there are more content types at your community, you have to create new templates for them. This is how:

(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>
  • Like
Reactions: THLove
There are some new options you can set to optimize the Related Contents result:
- Disallowed Tags
- Min Tag Length
- Word Count Limit


Options  Content Tagging.webp
  • Like
Reactions: THLove
- Fixed Content Types option.
  • Like
Reactions: THLove
Top Bottom