Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Embed opens specific category or topic?
I'd like to embed a specific category or topic on a page. Is there a different embed code or option?
For example when a user opens up a page on my blog the embed will open General Discussion Category and topic #1 for example.
For example when a user opens up a page on my blog the embed will open General Discussion Category and topic #1 for example.
2
Comments
http://forum.boxesandtext.com
http://alpha.boxesandtext.com
Looks like there are two ways: 1. modify the URL hash when the user loads the page, or 2. set javascript variables before loading the embed code.
First, load the page you want and check out the URL. For way 1, copy everything that comes after ?p=________. For way 2, you'll need to somehow get discussion id, foreign_id, etc... May take some digging.
In short, the simplest way is go set window.location.hash before you load the embed script.
EXAMPLE:
Thank you Akumpf for the reply. This is exactly what I been looking for a while now and works perfectly! I tried Way 1 and its very simple to use. I have a question about way 2. If I was to use way 2, I see there are more options but what exactly does it do compared to way 1?
Anyways thanks so much for the code!
For now, I'm sticking with way 1 (setting window.location.hash before embedding).
I get an error: "Code corrupted. Insert fresh copy."
I added:
<div style=""> <script> window.location.hash = "#/post/discussion"; </script> <script type="text/javascript" src="http://<sub>.<domain>/js/embed.js></script> </div>
There must be some additional thing that I'm missing.
@michaelmross
3 problems I see.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.