XF 2.2 make solution in question thread full length

Ferdinand

Well-known member
It would be better to show the full thread first rather than this go to thread ("view full post") solution, if it's even a simple duplicate that would be fine. Does anyone have a solution for this?Screenshot 2024-02-12 at 13.37.20.webp
 
Solution
For this we will need to make some small changes to the thread_view_type_question template.



Instructions

First, go to the thread_view_type_question template and find the following code block:

HTML:
<article class="message-body">
    <div class="message-expandWrapper js-expandWatch">
        <div class="message-expandContent message-expandContent--small js-expandContent">
            {{ bb_code_snippet($post.message, 'post', $post, 750) }}
        </div>
        <div class="message-expandLink"></div>
    </div>
</article>

Completely replace this code block with the following:

HTML:
<article class="message-body">
    {{ bb_code($post.message, 'post', $post) }}
</article>

If...
For this we will need to make some small changes to the thread_view_type_question template.



Instructions

First, go to the thread_view_type_question template and find the following code block:

HTML:
<article class="message-body">
    <div class="message-expandWrapper js-expandWatch">
        <div class="message-expandContent message-expandContent--small js-expandContent">
            {{ bb_code_snippet($post.message, 'post', $post, 750) }}
        </div>
        <div class="message-expandLink"></div>
    </div>
</article>

Completely replace this code block with the following:

HTML:
<article class="message-body">
    {{ bb_code($post.message, 'post', $post) }}
</article>

If you also want to remove the "View full post" button, you can delete this code block:

HTML:
<footer class="message-footer">
    <div class="message-actionBar actionBar">
        <div class="actionBar-set actionBar-set--internal">
            <a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}"
                class="actionBar-action actionBar-action--view"
                data-xf-click="attribution"
                data-content-selector="#post-{$post.post_id}"
                rel="nofollow">{{ phrase('view_full_post') }}</a>
        </div>
    </div>
</footer>

Let me know if there are any problems.
 
Solution
Top Bottom