kojimarou Posted December 8, 2010 Posted December 8, 2010 First i'll start with the background: I work for my University's Tech support and head their knowledgebase system. We are having an issue where we create links to specific knowledgebase articles with the intention that they long in to the site as a guest, but the system keeps forcing a login page. The issue is solved if you load up the main knoledgebase portal page first, but I want our users to just click a link to get where they want (seriously any additional steps and these users will have an Aneurysm). Apparently an upgrade to the portal version would fix the issue, but the company that owns the software are being pricks about it, apparently avoiding any further upgrades until the newer version comes out. I don't have access to the code of the system since it's technically a software package they purchased. The place is seriously underfunded right now so anything that might cost money is out of the question. So here's the idea I had. I want to create an HTML file that I can throw on the web server that will load the portal page first, and then redirect to the knowledbase article. I had the idea of using a frame and a refresh call to achieve this but then I'd have to have an HTML file for every link I make, and unfortunately I do not have direct access to the server so it needs to be a one time thing. I would like to try and do this using forms or something similar like an embedded url, anything more like asp and javascript would be too much cause their web server is archaic (I think they are using Windows Server 2003 to host the page... so I'm not going to reveal which university it is... lol). Quote
Sparda Posted December 8, 2010 Posted December 8, 2010 An easier solution might be to put an iframe that contains the knowledgebase portal page on the page where the links are (could even be 1px by 1px). In that way, the knowledge base will think that the user has been to the portal page (because they have). Quote
kojimarou Posted December 8, 2010 Author Posted December 8, 2010 An easier solution might be to put an iframe that contains the knowledgebase portal page on the page where the links are (could even be 1px by 1px). In that way, the knowledge base will think that the user has been to the portal page (because they have). That's a good idea. The only issue is that the pages that have links are pages created by a Wordpress install that is incredibly limited, it doesn't even allow forms without approval, so I doubt an iframe would be allowed. What I might be able to do is just have a landing page with all the links to different articles. This would undermine a lot of the page designs that people have since several people are in charge of different pages, so if that's the best option I'll have to try and do some convincing. Quote
kojimarou Posted December 8, 2010 Author Posted December 8, 2010 This is what I came up with using snippets from example code, but it just doesn't seem to work. I iframe portion works fine, but the redirect doesn't happen. Can someone find the problem with this code? I'm trying to use the URL: page.htm?loc=www.pageurl.com Here is my code: <iframe src ="https://kbportalpage.edu" width="1" height="1"></iframe> <script language="JavaScript" type="text/javascript"> <!-- function getUrlVars() { var map = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { map[key] = value;}); return map; } function doRedirect() { setTimeout( "window.location.href = map['loc']", 2*1000 ); } //--> </SCRIPT> Quote
digip Posted December 8, 2010 Posted December 8, 2010 (edited) I would go the route sparda mentioned. Make an iframe and then have links that target the iframe itself. For example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Knowledgebase</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=100" /> <!-- Force IE8 Compatibility mode OFF --> </head> <body style="background:#fff; color:#000;"> <div style="display:table; margin:0 auto 0 auto;"> <div style="float:left; width:200px; padding-right:30px; display:block;"> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> <a href="kb-article-url" target="kb">Your link titles</a><br /> </div> <iframe src="kb-home-login-portal-url" name="kb" style="width:900px; height:600px;">You need an iframe capable browser to see this.</iframe> </div> </body> </html> The target="kb" points to the iframe, and will load the urls you want on the site. By loading the kb portal first, then clicking the kb links should work if what you are telling us is true about having to be loaded first to reach them. Granted this will probably look horrid and need some adjusting, this was just thrown together as an example. Edited December 10, 2010 by digip Quote
Infiltrator Posted December 9, 2010 Posted December 9, 2010 Just use an Iframe, it will save youself a lot of time and you won't need to mess with any scripting language. You should use the example Digip provided, it really does make a lot of sense, instead of experimenting with thousands of pages. Quote
Matty B Posted December 9, 2010 Posted December 9, 2010 Assuming the web server fronting this portal is Apache you could just use some redirect trickery to 301 to main portal page than use more re-direct trickery to go back to the destined page. I would need to have a sample URI for a KB article and the main page though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.