1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Change link behaviour in Alert drop down

Discussion in 'XenForo Questions and Support' started by Neil E., Sep 26, 2012.

  1. Neil E.

    Neil E. Active Member

    Minor thing, but I find I click too quickly in the drop down and often hit the user link instead of the topic link. How do I remove the user link? (ie Jake's name wouldn't have a link)

    xenforo73.jpg

    Once I'm at the topic I can click on the user link below the poster's avatar if I need to see user info.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> alert_post_insert

    Replace the red code:

    Code:
    {xen:phrase x_replied_to_thread_y_may_be_more,
    	'name={xen:helper username, $user, 'subject'}',
    	'title=<a href="{xen:link posts, $content}" class="PopupItemLink">{xen:helper threadPrefix, $content}{$content.title}</a>'}
    
    With the blue code:

    Code:
    {xen:phrase x_replied_to_thread_y_may_be_more,
    	'name={$user.username}',
    	'title=<a href="{xen:link posts, $content}" class="PopupItemLink">{xen:helper threadPrefix, $content}{$content.title}</a>'}
    
     
  3. Neil E.

    Neil E. Active Member

    Using TMS


    search
    Code:
    {xen:phrase x_replied_to_thread_y_may_be_more,
    'name={xen:helper username, $user, 'subject'}',
    'title=<a href="{xen:link posts, $content}" class="PopupItemLink">{xen:helper threadPrefix, $content}{$content.title}</a>'}


    replace
    Code:
    {xen:phrase x_replied_to_thread_y_may_be_more,
    'name={$user.username}',
    'title=<a href="{xen:link posts, $content}" class="PopupItemLink">{xen:helper threadPrefix, $content}{$content.title}</a>'}
    doing a save and check verifies that the difference exists

    That was a quick and easy change, but it still turned into a link when hovered, and still functioned as a link. Using Firebug it shows up as "<a class="username subject" href="index.php?members/a.7/">A</a> (same with or without the edit)

    I logged in as user A and quoted a post to generate the alert. This template edit is simple enough I'm sure I did it correctly.

    Just in case the TMS failed I went and edited alert_post_insert directly with the same result. Is the syntax correct?
     
  4. Neil E.

    Neil E. Active Member

    Well I messed around with this a bit more, changing $user.username to only $user or username just to see what changed. This removed the username completely. Then I switched it back to Jake's $user.username and the edit finally took hold. No highlight to the username (or link operation) as desired. It's very frustrating that some edits don't "take" regardless of whether they are direct edits, TMS edits or EXTRA edits.

    The side effect of this template change is that the whole secondary content area of the alert dropdown now becomes a link to the topic. This means that clicking on the avatar, the topic link or any text area or blank area performs the topic link function. Mousing over any of these areas turns the arrow cursor into a hand cursor and the background changes shade (indicating that the link is everywhere). With this happening, the normal link underline from mousing over the actual topic link looks odd. This is one edit I might not keep.

    I seem to be the only person to routinely get what I call "edit weirdness". XF would be much easier to use if this didn't happen.
     

Share This Page