Jump to content

display category description on the list of posts


Go to solution Solved by Nathan Explosion,

Recommended Posts

Posted

Hello everyone,

I was wondering whether it is possible to place the description field of a forum discussion at the top of a post included in that discussion category. 

There will be many different discussion categories. The description explains what it is about, however, when we are inside the different posts inside the discussion category, the description is not shown. You can see an example of what I am trying to explain in the screenshot attached. Can description 1 be shown under the channel name when we are inside the category? 1 shown at 2. Is there a way to do that or create a plugin that sort of allows me to do that? Thanks a lot 

aaa.thumb.jpg.fcc528585a6f0f38a2a87bc055d5160e.jpg

  • Solution
Posted

The template you would need to edit it is forums -> front -> topics ->topic.

Search for the following in there:

{{if $topic->canEdit()}}
	<span class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
		<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$topic->title}</span>
	</span>
{{else}}
	<span class='ipsType_break ipsContained'>
		<span>{$topic->title}</span>
	</span>
{{endif}}

Within that, you can add in the following items to display information about the forum:

{$topic->container()->metaTitle()}

{$topic->container()->metaDescription()}

Example - replacing the above with the below gives you the result in the image:

{{if $topic->canEdit()}}
	<span class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
		<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$topic->title}</span>
		<br>
		<span>{$topic->container()->metaTitle()}</span>
		<span>{$topic->container()->metaDescription()}</span>
	</span>
{{else}}
	<span class='ipsType_break ipsContained'>
		<span>{$topic->title}</span>
		<br>
		<span>{$topic->container()->metaTitle()}</span>
		<span>{$topic->container()->metaDescription()}</span>
	</span>
{{endif}}

image.thumb.png.0baad845707c6fb1cf1b01a7f6733609.png

Posted (edited)
On 2/2/2021 at 2:23 PM, Nathan Explosion said:

The template you would need to edit it is forums -> front -> topics ->topic.

Search for the following in there:



{{if $topic->canEdit()}}
	<span class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
		<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$topic->title}</span>
	</span>
{{else}}
	<span class='ipsType_break ipsContained'>
		<span>{$topic->title}</span>
	</span>
{{endif}}

Within that, you can add in the following items to display information about the forum:



{$topic->container()->metaTitle()}

{$topic->container()->metaDescription()}

Example - replacing the above with the below gives you the result in the image:



{{if $topic->canEdit()}}
	<span class='ipsType_break ipsContained' data-controller="core.front.core.moderation">
		<span data-role="editableTitle" title='{lang="click_hold_edit"}'>{$topic->title}</span>
		<br>
		<span>{$topic->container()->metaTitle()}</span>
		<span>{$topic->container()->metaDescription()}</span>
	</span>
{{else}}
	<span class='ipsType_break ipsContained'>
		<span>{$topic->title}</span>
		<br>
		<span>{$topic->container()->metaTitle()}</span>
		<span>{$topic->container()->metaDescription()}</span>
	</span>
{{endif}}

image.thumb.png.0baad845707c6fb1cf1b01a7f6733609.png

Thanks so much!!! Much appreciated!

Edited by Alfonso Moreno
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...