XF 2.2 <xf:if is="$thread.cover_image"> / <xf:elseif is="$forum.node_id == 1" />

Ruh

Active member
Code:
<xf:if is="$thread.cover_image">
    <a href="{$linkUnread}" class="articlePreview-image" style="background-image: url('{$thread.cover_image}')" aria-hidden="true" tabindex="-1">&nbsp;</a>
<xf:elseif is="$forum.node_id == 1" />
.........


I want to add photos to each topic according to its id.
However, there should not be a photo by default. Only photos provided for ID should be included.


Can you please help me how to do this?
 

Attachments

  • xxx.webp
    xxx.webp
    54.7 KB · Views: 13
post_article_macros

Code:
<xf:if is="$thread.cover_image">
                <a href="{$linkUnread}" class="articlePreview-image" style="background-image: url('{$thread.cover_image}')" aria-hidden="true" tabindex="-1">&nbsp;</a>
            </xf:if>

uses this feature.
I'm trying to fix this as a photo that I assign to the category id.

This is the code I'm trying to do.

Code:
<xf:if is="$thread.cover_image">
                                    <a href="{{ link('threads', $thread) }}" class="articlePreview-imagex" style="background-image: url('https://www.oyunforum.com/homep/pubg2.jpg')" alt="{$thread.title}" aria-hidden="true" tabindex="-1">&nbsp;</a>
                                    <xf:else />
                                    <a href="{{ link('threads', $thread) }}" class="articlePreview-imagex" style="background-image: url('https://www.oyunforum.com/homep/pubg2.jpg')" alt="{$thread.title}" aria-hidden="true" tabindex="-1">&nbsp;</a>
                                </xf:if>

Do not add a default photo. I can add photos by category.
But how ?

Thank
 
Back
Top Bottom