PDA

View Full Version : Html direct to within CMPS box


russbo
11-25-2004, 02:27 PM
I'd like to have an image link inside a center CMPS box, that people can click on, so that it directs them to a page on another server (not the server the forum/CMPS system is on). At this point, using one of the custom collapsing boxes, I've got the following code opening up a NEW browser page. Using "self" does not change anything. I'd like to have the new link open within the CMPS page, so that it keeps the structure of my entire site navigation intact.

Also, is there a way to have this link open automatically within this CMPS box??

<tr>
<td class="alt1" align="center"><BR>
<a href="http://www.russbo.com/site_map.htm"
target="_blank"><img src="http://www.russbo.com/image.htm" name="image" border="0"></a>
<BR>
</td>
</tr>

Thanks. Happy bird day.
rich

Brian
11-26-2004, 01:44 PM
iframe maybe?

Our Sponsors
 

russbo
12-03-2004, 12:51 AM
Don't know. I actually avoided the issue by putting a gif in the box directing people to a completely new html page, which, as it turns out, ended up working better.

theMusicMan
12-03-2004, 10:24 AM
How about making the new page you are trying to open from the module image URL a new ?page in vBaCMPS...?

1 - create and save a new template called say adv_portal_sitemap
2 - create a new page in CMPS that calls this template called sitemap
3 - Use that new CMPS page as the image URL in the module you quote from above....??? i.e.

<tr>
<td class="alt1" align="center"><BR>
<a href="http://www.russbo.com/site_map.htm"><img src="http://www.russbo.com/index.php?page=sitemap"></a>
<br>
</td>
</tr>

No need for the target=_blank then either as this should open the sitemap page within CMPS.
Would that work...?

Our Sponsors
 

KW802
12-03-2004, 10:38 AM
russbo, did you use "self" or "_self"? ;)

theMusicMan
12-03-2004, 12:05 PM
Using "_self" would only open the URL in the same browser window - not within the vBaCMPS selected template et al.

KW802
12-03-2004, 12:10 PM
Using "_self" would only open the URL in the same browser window - not within the vBaCMPS selected template et al.HHHmm... I misread his original post. When he tried "self" it opened up a new window which it should not have; using "_self" would fix that problem.

But in the end that's not the problem he's really trying to fix. Whoops.

KW802
12-03-2004, 12:50 PM
Russbo, do you care if the URL for the 2nd server is shown in the URL or are you trying to make it hidden?

theMusicMan
12-03-2004, 03:35 PM
Doesn't the new page function act like a sort of 'wrapper' for whatever template you are pulling into vBa? So, essentially, you can pull any html page into an adv_portal template and call that as a new CMPS page, then have it shown on vBa. If you included the content from say tMP (my site) in your own template - then tMP would be displayed within your vBa page.

russbo
12-06-2004, 12:20 AM
Yes, that's what I was thinking. I had tried all of these suggestions, can't seem to get it to work. Appreciate the feedback. One option is just to put an image inside the cmps box, and hyperlink that to a new browser window with the html that you want to show (which is what I'm doing). But having outside html show inside a cmps box, like the newsfeed cmps, would be an interesting feat.

KW802
12-06-2004, 12:52 AM
Yes, that's what I was thinking. I had tried all of these suggestions, can't seem to get it to work. Appreciate the feedback. One option is just to put an image inside the cmps box, and hyperlink that to a new browser window with the html that you want to show (which is what I'm doing). But having outside html show inside a cmps box, like the newsfeed cmps, would be an interesting feat.Russbo, as Brian already said the answer would be with an iframe. The only question is how complicated do you want to make it hence my last question about whether you care the 2nd site is shown in the URL or not. The other part of 'how complicated do you want to make it' equation is whether the 2nd site is on your own web farm or if you're talking about a totally different site or not.

russbo
12-09-2004, 02:10 PM
Did it. Thanks guys, you're all incredible. Used the custom box that someone here created, and, the javascript that another here created, and combined them. (Sorry, forget their names, but I am NOT responsible for creating this script; I take absolutely no credit)

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('custom_1')"><img id="collapseimg_custom_1" src="$stylevar[imgdir_button]/collapse_tcat$collapseimg_custom_1.gif" alt="" border="0" /></a>
<span class="smallfont"><strong>$vba_options[portal_blockbullet] russsbo CNI TEST</strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_custom_1" style="$collapseobj_custom_1">
<tr>
<td class="$getbgrow">
<!-- Begin custom code -->
<script type="text/javascript">
function autoResize() {
var dest = document.getElementById('container');
var source = window.frames[0].document.body.innerHTML;
dest.innerHTML = source
} </script>
<div id="container">
<iframe onload="autoResize();" src="http://www.msnbc.com" frameborder="no" width="100%" scrolling="yes">
</div> <!-- End custom code -->
</td>
</tr>
</tbody>
</table>
<br />

Works great. Just got to make the custom box longer and I'm good to go.

Thanks for everyone's help.

rich
www.russbo.com

russbo
01-10-2005, 01:07 AM
The only problem with the above, is that the html page "overflows" the confines of the cmps box; ie, it obliterates the right cmps column. Any idea how to keep the html within the cmps box??? Changing the width does not keep it confined.

You can see the problem here: http://x.russbo.com/index.php?page=cni

Thanks!
rich

russbo
01-10-2005, 03:34 AM
Also discovered another thing. Having this html inside a cmps box disables the footer, so it wipes out the style chooser drop down menu. And, it destroys the navbar drop down menus also.

Must be some sort of conflict with the footer template, or, it prevents anything below it from "functioning". Wish someone could come up with a fix for this.

Thanks!
rich

russbo
01-11-2005, 09:00 PM
Nabs, read this thread. It's all here:

http://www.vbadvanced.com/forum/showthread.php?t=1466

1996 328ti
01-13-2005, 09:17 PM
The only problem with the above, is that the html page "overflows" the confines of the cmps box; ie, it obliterates the right cmps column. Any idea how to keep the html within the cmps box??? Changing the width does not keep it confined.
Did you figure this out?
This is a pretty neat block.
I would like to retain the footer and have the content block height 100%
http://www.318ti.org/index.php/index.php?page=test

KW802
01-13-2005, 09:44 PM
Did you figure this out?
This is a pretty neat block.
I would like to retain the footer and have the content block height 100%
http://www.318ti.org/index.php/index.php?page=testIf (and only if) the content that you're trying to frame is on the same site as the rest of your site then try this template:<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_cmps_iframe')">
<img id="collapseimg_forumhome_cmps_iframe" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" alt="" border="0"/>
</a>
<strong>
<span class="smallfont">$vba_options[portal_blockbullet] $mods[title]</span>
</strong>
</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_cmps_iframe" style="$vbcollapse[collapseobj_forumhome_cmps_iframe]">
<tr><td>
<!-- START OF IFRAME CODE -->
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="$getbgrow" width="100%" height="100%">
<html>
<head>
<script language="JavaScript">
<!--
function calcHeight(obj) {
var buffer = 0;
var browser_name=navigator.appName;
if (browser_name.indexOf("Netscape")!=-1) {
buffer = 50;
}
var docHeight = the_iframe_object.document.body.scrollHeight;
obj.style.height = docHeight + buffer + 'px';
}
//-->
</script>
</head>
<body>
<iframe id="the_iframe" name="the_iframe_object" onLoad="calcHeight(this);" onResize="calcHeight(this);" src="http://www.318ti.org/registry/" scrolling="yes" frameborder="0" height="100" width="100%" >
An iframe capable browser is required to view this web site.
</iframe>
</body></html>
</td>
</tr>
</table>
<!-- END OF IFRAME CODE -->
</td></tr>
</tbody>
</table>
<br />

1996 328ti
01-13-2005, 10:03 PM
:)
WOW!
That is great!
Thank you!

KW802
01-13-2005, 10:06 PM
:)
WOW!
That is great!
Thank you!No problem. It was some code I whipped up for testing on my site so you may have to tweak it a bit if you come across anything but for most basic pages it should do the job. :)

1996 328ti
01-13-2005, 10:28 PM
I removed the $mod and changed the position of the strong tags.
It really fits in nicely. Now I just need to change the colors to blend in with the rest.

1996 328ti
01-14-2005, 09:17 AM
Only bummer it does not work with Safari. :(
http://www.318ti.org/index.php/index.php?page=registry
I get a scrollable box.

I wonder if I need to redirect safari users to the original html page?

KW802
01-14-2005, 09:42 AM
Only bummer it does not work with Safari. :(
http://www.318ti.org/index.php/index.php?page=registry
I get a scrollable box.

I wonder if I need to redirect safari users to the original html page?Sorry, but I don't have access to any Mac's right now to test it out. :( I normally test my stuff with IE6, FireFox, and Opera. In the future I may pick up one of those new cheap $500 iMac Mini that they've just announced so I can get my feet wet but, for now, sorry, I can't help out on that one.

Is there any chance it's just a security setting? The template requires JavaScript so maybe there is a setting.

1996 328ti
01-14-2005, 07:25 PM
No. It displays a box maybe 200 pixels high with a scrollable bar.
I wonder of using iframes is better than editing many vB files so they work with a side bar. This way I can have my forum as the content block.

KW802
01-14-2005, 08:40 PM
No. It displays a box maybe 200 pixels high with a scrollable bar.
I wonder of using iframes is better than editing many vB files so they work with a side bar. This way I can have my forum as the content block.From what you're describing it means that Safari isn't recognizing the javascript command to resize the object. In that template I put the default at 100px so with IE and FF the page loads with the frame being 100px high but then the javascript kicks in and resizes it.

Any error messages or anything displaying?

1996 328ti
01-14-2005, 09:32 PM
This is how it looks in Safari.

KW802
01-14-2005, 09:43 PM
This is how it looks in Safari. Yep, that's because of the reason above. ;)

1996 328ti
01-14-2005, 09:49 PM
I changed the height to 1200. Works fine. Firefox, NS look OK. Haven't looked at them on my PC yet. Thanks.