Please upgrade here. These earlier versions are no longer being updated and have security issues.

Emebed issue with Version 2.1b2

meshugymeshugy Musician/Hacker ✭✭

Hello,

I upgraded to Version 2.1b2 and am having an issue with embedding my forum. Vanilla does embed successfully here:

http://shoppingcart.djangobooks.com/vanilla-forum

However, all the links point towards the original location: http://www.djangobooks.com/vanilla-forum/

Is there a solution for this or is there a bug in this beta version?

Thanks,

Michael

«134567

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    beta version=there will be bugs

    the link to your forum looks good but the embed one is wrong.

    You should not use the name vanilla forum for the page where you embedded . Try calling it forum1.

    Try to embed by just pasting the code into a div in the page . Check that the url from where you embedded matches the one in the dashboard.

    http://www.djangobooks.com/vanilla-forum/ <<<this one goes to a stand alone embedded forum

    http://shoppingcart.djangobooks.com/vanilla-forum <<<<<this one is a 404 not found

    http://www.djangobooks.com/forum/ <<<this one goes to a nice forum that matches your site

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    i actually moved the embedded forum to this url:

    http://shoppingcart.djangobooks.com/new-forum

    If you click on any of the discussions or categories, it will open a new window. Any idea why that is?

    Other links for the profile or activity open withing the embedded site.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    you need to use a web inspector or view the source code, everything still points to the other forum, vanilla-forum.

    Not sure what you are doing or how. Could you explain your methods?

    It is easy to embed anything, in fact you can simply use this below to embed.

    <iframe src="http://www.djangobooks.com/new-forum/"></iframe>

    or you can use the code from the dashboard to embed , or you can use that plus the plugins.

    I think if you are new to 2.1 you should first try to get the embedding right. In any way.

    Every time you change the forum directory you must change the .htaccess file to match the new place.

    You need to empty the cache and then look at ways to add jquery to force the links to open in the same page if it is possible.

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    I'm using Vanilla's embed code. I used the embed plugin with ver. 2.0.18 and it worked perfectly. I guess 2.1b2 is still a little buggy as it doesn't embed as well.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I don't think the problem is with embedding. I think you may not have configured something right. The user pics should be in the uploads/userpics folder. Yours, the ones you can't see are being called from uploads/ .

    Try again. My question is Why embed at all ? Is it to integrate ? single sign on?

    Maybe try to set the forum up first before you embed it. Once it works, then try the embed.
    You can make it look exactly like your site.

    Check your .htaccess file that it is correct.

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    Yes, I'd like to embed the forum so I can better integrate it with my store via SSO. People are always getting confused by having the forum in a different location with a different login system.

    Vanilla is working fine for me with it's own url: http://www.djangobooks.com/vanilla-forum

    There are some features I wanted to use in the beta 2.1b2, but if I can't get the discussion links to open in the iframe, than I'll just switch back to the stable version which works.

    I took a look at the .htaccess and it's set like this:

    # Modified
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       RewriteBase /vanilla-forum
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    
    

    Is that correct?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok that look good, now, is that how you want it to look? style wise? You can use any theme to embed. The only reason this is called embed friendly is because it is flexible in widths. You can make any theme fit the embed area.

    You can have SSO on a standalone forum. It does not matter where your forum is. You configure that in the SSO plugins. If you put a link on your site menu to the forum it is the same thing as a link to the embed.

    You can make the sites look identical so they never realize they are going elsewhere.

    Try to make your forum match your site.

    or

    Try to embed by just adding the iframe and see what happens. This works for me on WP.

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    Yeah, I may go with a stand alone forum if the embedding is too problematic. However, it seems to work really well (other than the discussions opening as new windows.) The embed friendly theme looks nice inside my store with no modifications:

    http://shoppingcart.djangobooks.com/new-forum

    If I make a whole new site, we'll have to do a lot of skinning which creates headaches as every time there's an update or a new mod installed, it will be less likely to work with a custom skin.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2013

    Upon further study of your source, actually I embedded your forum in a WP page on my site to be able to experience what is happening.

    The links are opening in a new window because target ="_blank is being added to them. I am not sure if it is a function of the remote.js or embed.js I will have to see.

    You can try this to override it if you add this to the default.master.tpl

    {literal}
    <script type="text/javascript"> 
    $(document).ready(function() {
    
    $('.Title a').attr('target', '_self');  
    $('.MessageList a').attr('target', '_self');
    $("#Head a").attr("target", '_self');
    $(".AptAdImg a").attr("target", '_self');
    $(".Attachment a").attr("target", '_self');
    $(".Meta a").attr("target", '_self');
    $('.SiteMenu a').attr("target", '_self');
    $('span.onebit_mp3 a').attr("target", '_self');
    $("a.ReactButton.Quote.Visible").attr("target", '_self');
    
    });
    </script>
    {/literal}
    

    You will need to inspect the source code to get all the actual classes of the links affected by this. Simply find the ones that have target="_blank" added to them and copy the class.

    You can also make all the links open in the same window by applying the code to all links, but you may want some links to open in a new window .

    If you don't want any links to open in a new window just apply the code to all potential a links.

     $('.a').attr('target', '_self'); 
     $('a:link').attr('target', '_self');  
     $('a').attr('target', '_self'); 
    
    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    Thanks for looking into this! I tried the code you posted (I added it after the head tag in the default.master.tpl of the Embed theme. Neither versions seemed to have any effect. Did I add the code in the right place?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok , hmm the issue is that you may need to set another rule in the htaccess file possibly, but I am not seeing the script ...

    Make sure it is the head tag not the Head tag. Also, make sure the classes are correct. I gave you an example based on what I have. You must look at the source code of the forum and find the right classes pertaining to those links.

    Also try setting in the config.php to TRUE or FALSE see what works.

    $Configuration['Plugins']['EmbedVanilla']['ForceRemoteUrl'] = TRUE;

    If you look at the source code to the embed, you will see that js is adding target _blank.

    You may be able to change that also in the remote.js or the embed.js somewhere in there it is adding the target blank to links. It is just a matter of changing them to _self

    hgtonight
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I tested this with one of my 2.1 Installs, I mean I embedded it to see if it also opened new windows. It does not. I am starting to think this issue has to do with the theme.

    Please try this theme of mine that works on 2.1 and it does not open new windows for me. You can change the background to match your site .

    Let me know if this works. If it does, them we will know the issue is with the default theme or the theme you are using.

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    thanks, I installed your theme but has the same problem.

    However, I did try this theme and it does open all links within the iframe:

    http://www.vanillaskins.com/themes/response/

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Ok well thanks for testing and now we know it may well be related to themes. I am curious as to why my theme did not as it does for me. Did you try the configuration above ? What is the line you have in your config.php ?

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    I tried the force remote url before and it sort of works as it opens a new page and then shows the embedded version.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    If you wanted the forum to be in shoppingcart , why not install it in that subdirectory ?

    http://shoppingcart.djangobooks.com/new-forum

    instead of having it in

    http://www.djangobooks.com/new-forum

    Is the shopping cart the forum? Then I don't see the need for it to be installed in the main root domain subdirectory.

    Not that this will make a dif about the links. But it might....

    hgtonight
  • meshugymeshugy Musician/Hacker ✭✭

    i'm just testing it out so the current location is temporary. The shoppingcart will be moved to the url djangobooks.com and the blog that is there now will be embedded into the cart, along with the forum.

  • meshugymeshugy Musician/Hacker ✭✭

    I tried your mod to the default.master.tpl again. The discussion and category links stilled opened in new windows, but I did notice that when I inspected the element the target ="_blank was gone.

  • meshugymeshugy Musician/Hacker ✭✭
    edited December 2013

    I'm still not having any luck getting discussion links to open within the iframe. I did notice that other links on the forum that DO open within the embedded iframe properly are formatted as such:

    <a href="/vanilla-forum/discussions" class="Selected">Discussions</a>
    <a href="/vanilla-forum/activity" class="">Activity</a>
    

    etc...

    Whereas the links that open in a new window are formatted like this:

    <a href="http://www.djangobooks.com:80/vanilla-forum/discussion/1550/guitar-wars#latest">Guitar Wars</a>
    
    <a href="http://www.djangobooks.com:80/vanilla-forum/discussion/1033/minor-swing-tune-of-the-month-    dec-05#latest">Minor Swing: Tune of the Month, Dec '05</a>
    

    The target="_blank" actually doesn't appear on most of the discussion links. However, they are formatted with the complete url which makes me wonder if that's the problem. Does anyone have any insight into why the Discussion links are formatted this way and if there's a way to produce them in a way that will link into the iframe instead of a new window?

    As always, thanks for your consideration,

    Michael

  • meshugymeshugy Musician/Hacker ✭✭

    My 2.1b2 forum is now live here: http://www.djangobooks.com/

    Everyone loves it! :)

    But I'd like to embed it in my store here: http://shoppingcart.djangobooks.com/forum

    I have the following embed code inserted:

    In the page: http://shoppingcart.djangobooks.com/forum

    But it won't display the forum. Does anyone have an idea what the problem is?

    I did get the forum to embed in my blog: http://www.djangobooks.com/blog/discussions-2/

    So I know it works in some instances. But I want it to embed in the store so I need to figure out what the problem is.

    Thanks for your help....

Sign In or Register to comment.