XF 2.3 Syntax error in custom template

Milen

Active member
Hello to the entire XenForo community. I'm trying to make a news ticker but I'm encountering a problem that I can't find a solution to.
Code:
<a href="{{ link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
There is an error in this line and I don't know where it is and how to fix it. Of course I tried and...
Code:
<a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
But the problem remains..... And this is the entire template code:
Code:
<div class="newsTicker">
    <marquee behavior="scroll" direction="left">
        {% for thread in threads %}
            <a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a> |
        {% endfor %}
    </marquee>
</div>

<style>
.newsTicker {
    background: #222;
    color: #fff;
    padding: 10px;
    overflow: hidden;
}
.newsTicker a {
    color: #fff;
    margin-right: 15px;
}
</style>


If anyone can help I would be grateful. I wish you a light, peaceful and successful day. :giggle:
 
Solution
Hello to the entire XenForo community. I'm trying to make a news ticker but I'm encountering a problem that I can't find a solution to.
Code:
<a href="{{ link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
There is an error in this line and I don't know where it is and how to fix it. Of course I tried and...
Code:
<a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
But the problem remains..... And this is the entire template code:
Code:
<div class="newsTicker">
    <marquee behavior="scroll" direction="left">
        {% for thread in threads %}
            <a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a> |
        {% endfor %}...
Hello to the entire XenForo community. I'm trying to make a news ticker but I'm encountering a problem that I can't find a solution to.
Code:
<a href="{{ link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
There is an error in this line and I don't know where it is and how to fix it. Of course I tried and...
Code:
<a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a>
But the problem remains..... And this is the entire template code:
Code:
<div class="newsTicker">
    <marquee behavior="scroll" direction="left">
        {% for thread in threads %}
            <a href="{{xf:link('threads', {'thread_id': thread.thread_id}) }}">{{ thread.title }}</a> |
        {% endfor %}
    </marquee>
</div>

<style>
.newsTicker {
    background: #222;
    color: #fff;
    padding: 10px;
    overflow: hidden;
}
.newsTicker a {
    color: #fff;
    margin-right: 15px;
}
</style>


If anyone can help I would be grateful. I wish you a light, peaceful and successful day. :giggle:

Are you confusing Xenforo with Django? :)
The marquee tag is deprecated and is not recommended for use.
Code:
<div class="newsTicker">
    <div class="marquee" >
        <xf:foreach loop="$threads" value="$thread">
            <a href="{{ link('threads', $thread) }}">{$thread.title}</a>
        </xf:foreach>
    </div>
</div>

<style>
.newsTicker {
    background: #222;
    color: #fff;
    padding: 10px;
    overflow: hidden;
}
.newsTicker a {
    color: #fff;
    margin-right: 15px;
}
.marquee {     
   animation: marquee 10s linear infinite;
}     
@keyframes marquee {
    0% {
        transform: translateX(100%)
    }
    100% {
        transform: translateX(-100%);
    }
}
</style>
This code is just an example to make it clearer which way you should go. :)
 
Solution
Back
Top Bottom