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

Conversation in Overlay

Discussion in 'XenForo Questions and Support' started by Tracy Perry, Nov 4, 2012.

  1. Tracy Perry

    Tracy Perry Well-Known Member

    I have some users that are fixated on the fact that to read a conversation they have to leave the forum they are in, read the conversation, then re-enter the forum. They have asked for the ability to have the conversation in
    A) another browser tab/window
    B) (my preferred) an overlay similar to what pops up for the logon, etc.

    Is this currently doable in the software as it is, and if so, what does it take to make it so?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Tried to add the overlay trigger to this template:

    Admin CP -> Appearance -> Templates -> conversation_list_popup_item

    <li class="listItem{xen:if '{$conversation.isNew}', ' unread'} PopupItemLink">
    	<xen:avatar user="$conversation" size="s" img="true" class="plainImage" />
    	<div class="listItemText">
    		<h3 class="title"><a href="{xen:link "conversations{xen:if {$conversation.isNew}, '/unread'}", $conversation}" class="OverlayTrigger PopupItemLink">{$conversation.title}</a></h3>
    		<p class="muted" title="{xen:phrase last_reply_by_x, 'name={$conversation.last_message_username}'}">
    			{xen:phrase last_message_by_x, 'name={xen:helper username, $conversation.last_message}'},
    			<xen:datetime time="{$conversation.last_message_date}" />
    Didn't work like I expected. Not sure why.
    Tracy Perry likes this.
  3. Tracy Perry

    Tracy Perry Well-Known Member

    I see what you mean.. it will pull it up, but you cannot reply to anything. Wonder if that is another template that needs to have an overlay trigger installed in it (as he starts rummaging around the styles).
  4. Tracy Perry

    Tracy Perry Well-Known Member

    Got it to open in another tab by using:
    <a href="{xen:link "conversations{xen:if {$conversation.isNew}, '/unread'}", $conversation}" class=" PopupItemLink" [COLOR=#ff0000]target="_blank"[/COLOR]>{$conversation.title}</a>
    Did this via TMS. At least it may work for now to keep the whiners a little happier. I'm still going to have to scrounge around and see if I can figure out why the overlay is not working... that would be slicker than ... well, I can't say it here. ;)
    Jake Bunce likes this.
  5. Chris D

    Chris D XenForo Developer Staff Member

    I've just been playing around and so far I've got this:

    But I've run out of time... :(

    I've hacked all this in as direct code edits so far which isn't ideal. I can also foresee other problems.

    If any one (Jake?) wants to take this off my hands that'd be awesome, if not I'll do some more work on it when I have time.

    EDIT: The current state is it has a load of inline CSS, probably doesn't function across pages of conversations and only allows you to view, rather than reply to messages.
    Jake Bunce, Tracy Perry and lazer like this.
  6. Tracy Perry

    Tracy Perry Well-Known Member

    Yep, that's pretty much what the code that Jake provided would do. When you go to reply it calls the /library/xenforo/ViewPublic/Conversation/reply.php, which I haven't figured out how to get to pull into the window to overlay the view of the ones you have. I'm just teaching myself PHP, so I'm still REAL wet behind the ears. It's been ages (literally - back in the OS/2 days) since I've done anything near code. If it can ever be made to work it will be a slayer addon/option/modification.
  7. Tracy Perry

    Tracy Perry Well-Known Member

    OK, I've taken it a little further - still haven't gotten the overlay opening, but now I have figured out how to get it to open in another window with a specific window size (yeah, I'm also learning HTML/CSS and all that other good stuff now).

    TMS edits to conversation_list_popup_item

    Search for:

    <a href="{xen:link "conversations{xen:if {$conversation.isNew}, '/unread'}", $conversation}" class="PopupItemLink">{$conversation.title}</a>
    Replace with:

    <a href="{xen:link "conversations{xen:if {$conversation.isNew}, '/unread'}", $conversation}" class=" PopupItemLink"
    onclick="window.open(this.href,'window','width=640,height=480,resizable,scrollbars,toolbar,menubar') ;return false;">{$conversation.title}</a>
    Jake Bunce likes this.
  8. Tracy Perry

    Tracy Perry Well-Known Member

    ARRGGHHHH! This was working fine... but now it has quit working on any of the browsers I use.

    Ended up having to place it in the conversation_add via TMS. Instructions in the resources now.

Share This Page