Skip to content

CTA banner for visitors

Solved Bugs
3 3 522 1
  • banner is duplicated, please see the pic attached.

    Screenshot 2026-04-28 at 10.46.33.png

  • banner is duplicated, please see the pic attached.

    Screenshot 2026-04-28 at 10.46.33.png

    @crazycells Yes, because of this code

    $(document).ready(function () {
        $(window).on('action:ajaxify.end', function (data) {
            if (config && config.uid > 0) {
                // User is logged in, so don't fire any message
            } else {
                // Insert content into the selected element
                var addAfterLastPost = $(
                    "<div class='alert alert-warning alert-dismissible fade show' role='alert'>" +
                    "<p><strong>Hello! It looks like you're interested in this conversation, but you don't have an account yet.</strong></p>" +
                    "<p>Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, " +
                    "and choose to be notified of new replies (ether email, or push notification). You'll also be able to save bookmarks, use reactions, and upvote to show your appreciation to other community members.</p>" +
                    "<p>With your input, this post could be even better 💗"+
                    "<br><br>"+
                    "<a style='margin-right:5px;' component='topic/reply/guest' href='/register' class='fw-semibold btn btn-sm btn-warning'>Register</a>" +
                    "<a component='topic/reply/guest' href='/login' class='fw-semibold btn btn-sm btn-info'>Log in</a>" +
                    "<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>" +
                    "</div>"
                );
                $('ul[component="topic"]').after(addAfterLastPost);
            }
        });
    });
    

    This was adopted into core as far as I know, so I’ve removed my manual code.

  • Very strange…
    Nothing in console ?

  • banner is duplicated, please see the pic attached.

    Screenshot 2026-04-28 at 10.46.33.png

    @crazycells Yes, because of this code

    $(document).ready(function () {
        $(window).on('action:ajaxify.end', function (data) {
            if (config && config.uid > 0) {
                // User is logged in, so don't fire any message
            } else {
                // Insert content into the selected element
                var addAfterLastPost = $(
                    "<div class='alert alert-warning alert-dismissible fade show' role='alert'>" +
                    "<p><strong>Hello! It looks like you're interested in this conversation, but you don't have an account yet.</strong></p>" +
                    "<p>Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, " +
                    "and choose to be notified of new replies (ether email, or push notification). You'll also be able to save bookmarks, use reactions, and upvote to show your appreciation to other community members.</p>" +
                    "<p>With your input, this post could be even better 💗"+
                    "<br><br>"+
                    "<a style='margin-right:5px;' component='topic/reply/guest' href='/register' class='fw-semibold btn btn-sm btn-warning'>Register</a>" +
                    "<a component='topic/reply/guest' href='/login' class='fw-semibold btn btn-sm btn-info'>Log in</a>" +
                    "<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>" +
                    "</div>"
                );
                $('ul[component="topic"]').after(addAfterLastPost);
            }
        });
    });
    

    This was adopted into core as far as I know, so I’ve removed my manual code.

  • phenomlabundefined phenomlab marked this topic as a question on
  • phenomlabundefined phenomlab has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics