Quick Nav:  Online Store   |   Login | Register

External Content question WebCapture

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
DavidWSnow
<250Posts
Posts:162


04/21/2008 10:29 AM  

John,

On my web site www.AgingSafely.com I have have a page that contains the data for each Adult Family Home listed with us.

I also have a parent portal for most of these homes with 2 pages (home and photos) 

I would like to find a way to make the data sheet from the first site to show up as a page on the parent portal. I have found two ways both with severe down sides:

  • Create a page on the parent portal and use and iFrame to display the contents of the data page. This doens't look good, it confuses Google Analytices.
  • Tell DNN to create a page that is a link and point to the original data page. This works with Google Analytics. However, the user has actually moved to our website, sees our menu and can't use our menu to get back to the parent portal.

I am hoping that with the amazing magic in your menu and mind, you might have a way to accomplish this without the negative side effects.

 

/DaveS

John Mitchell
Posts:2779


04/21/2008 10:45 AM  

Hi Dave,

I think I would do it with the WebCapture feature of PageBlaster.

With a WebCapture you get all the benefits of using an Iframe, but the results are actually injected into the page.

You can even make the capture dynamic if needed so that if you click on a link within the captured page it will result in another capture :

[PB:WebCapture(http://www.snapsis.com/default.aspx?[PB:Request.Url.Query]) ]

DavidWSnow
<250Posts
Posts:162


04/24/2008 4:01 PM  

I am a little confusded aboiut how to do this if I wanted www.Snapsis.com to appear as a page in one of my sites:

  1. In the parent portal create a page called Datasheet.
  2. Add Pageblaster to the page
  3. Add a rule with no search for and a replace with[PB:WebCapture(http://www.snapsis.com/default.aspx?[PB:Request.Url.Query]) ]

I tried this and I get a page of garbage and had to delete the page becasue I couln't access PageBlaster anymore.

A little more detail in the PB manual would help ;=} 

I was sure that PB would come to the rescue, it is the ultimate Swiss Army Knife for DNN

 

/DaveS

John Mitchell
Posts:2779


04/24/2008 4:11 PM  
You'll need to search for something in the rule you create. If you want to replace the entire page then Search For: .*
Host Account
<100 Posts
Posts:82


04/24/2008 4:57 PM  

Check this out:  http://www.snapsis.com/AgingSafely.aspx

DavidWSnow
<250Posts
Posts:162


04/25/2008 10:23 AM  

Love it.  Your are more than welcom to use this as an example. I welcome all links

I'll try the code very soon.  I wonder how Google Analytics counts the accesses?

 

/DaveS

DavidWSnow
<250Posts
Posts:162


04/25/2008 12:52 PM  

What I really want is the menu etc. from basic.agingsafely.com but the content from the datasheet.

What you have specified does exactly the same thing as putting a URL in the menu.

 

I suppose that I could create a basix.agingsafely.datasheet.aspx with only a token in an html module, then with PB:

  1. Get the real datasheet page
  2. replace the token on the first page with the contents of a div from the webcapture page

I was hoping for something simplier

 

/Dave

John Mitchell
Posts:2779


04/25/2008 1:21 PM  

Do you need two webcaptures pasted back together as one?

Doesn't your sub-portal already have the basic menu system?

You can make the WebCapture do two captures in one by adding more parameters.
After the original Url that you want to capture, you can specify search and replace parameters using regex.

If you let me know exactly what parts that you want to capture I can help you with the regex.

You could even setup several WebCaptures and assign the Search For in the rule as tokens like {Header}, {Data}, {Footer}
Then anywhere you use those tokens it will be replaced with a specific webcapture.

That is how I made this page:  http://drf.statfox.com/, all the navigation, header, and footer, are coming from http://www.drf.com, and the middle sports content comes from a different server. You can "see under the hood" by using this url: http://drf.statfox.com/?pbx=all

This is kind of like a reverse IFrame since we are hosting their Sports section, but templating it with automatic includes from their system.

 

DavidWSnow
<250Posts
Posts:162


04/25/2008 1:51 PM  
On http://basic.agingsafely.com/Services.aspx page I want to replace the ContentPane with the ContentPane from http://www.agingsafely.com/Listed_Homes/Datasheet/vrecordid/2475.aspx

/DaveS
John Mitchell
Posts:2779


04/26/2008 10:14 AM  

Ok, I updated my Webcapture at the link above using this rule:

SearchFor: {AgingSafelyData797}

ReplaceWith: [PB:WebCapture(http://www.agingsafely.com/Listed_Homes/Datasheet/vrecordid/2475.aspx, .*?Start_Module_797 -->(.*?).!-- End_Module_797.*,$1)]

 

Now anywhere I put the token {AgingSafelyData797} it will replace it with the capture from that module on that page.

 

 

John Mitchell
Posts:2779


04/26/2008 10:17 AM  

Oh, I almost forgot the most important part.  While I was making this work, I found a bug in my rule parser, so you'll need the latest DLL to do the capture of a group inside the WebCapture function.

I have attached the latest to this post.

 


Attachment: 14261761171.zip

DavidWSnow
<250Posts
Posts:162


04/27/2008 9:19 PM  

One quick clearification about the tokens and and the dilimiting characters

{AgingSafelyData797} are tye {} characters supposed to be in the token to be replaced?

On the page that I a capturing content from

ReplaceWith: [PB:WebCapture(http://www.agingsafely.com/Listed_Homes/Datasheet/vrecordid/2475.aspx, .*?Start_Module_797 -->(.*?).!-- End_Module_797.*,$1)]

what chars are the identifyinhg wrapper?   Start_Module_797 --> to End_Module_797

I am concernd that the characters not show so that the tokens should be comments I suppose.  I thoung that div's would be good but then I realized that regex would match the number of begining dis with the ending divs.

/DaveS

 

/DaveS

John Mitchell
Posts:2779


04/28/2008 7:24 AM  

You can make the token to be replaces anything you want. It you want to make it with comments around it and replace the comments with the token than you can be sure the token never shows up.

Yes, I identified the start and stop of the content with the Start_Module and End_Module, You can use something else there also, but it gets difficult to start and stop on Divs without something more unique to identify them.

Another idea would be to put some better start and end markers in your skin where you are getting the content from to identify everything in the content area.

DavidWSnow
<250Posts
Posts:162


04/28/2008 1:26 PM  

Almost got it working. See the differences between

http://basic.agingsafely.com/Services/tabid/1406/Default.aspx

and

http://www.agingsafely.com/tabid/263/Default.aspx?vRecordId=2475

A couple issues have come up.

  • Disabling cacheing also disables WebCapture.
  • PB seems to cache the WebCapture long after the page has been caputured or changed. I had to change the source of my PrintPage button to be just the div with the data rather than the whole ContentPane and change the "Return to List" button to be "Close Tab or Window" and they have stayed in  PB's cahce thru a cache flush, numerous ^Shift R's etc.
  • There appears to be more white space ahead of the moved text than there was on the original page.
  • Also I am copying the text from inside of the ListX module on the original page, where I have html comments dellimting the area being copied, yet I appear to be getting the module title and other items outside that area.

Otherwise good job.  I can see several places to use this. I suspect that I will have to combine its use with my Copy Title and Copy Description rules so that both the Datasheet page and the Services page have exactly the same title, so Google Ahalytics will show all of the access in one place.  Who knows maybe it will even double count them

Are the rules for a page executed in order?

/DaveS

DavidWSnow
<250Posts
Posts:162


04/29/2008 10:42 AM  

[PB:WebCapture(http://www.agingsafely.com/tabid/263/Default.aspx?vRecordId=2475, -->(.*?).!--(.*?)..*,$1)]

What do the --> before the (.*?) and the !-- after do for the regex?

Also I appear to be getting more that just the text between my HTML comments < !--StartDataSheet-- >  and < !--EndDataSheet-- >

If while I am on the Services Page I click on Login I get a Yellow screen exception

/DaveS

 

John Mitchell
Posts:2779


04/29/2008 10:56 AM  

Those were parts of the html comment for the start and end module in my example.  I used the period in front of !-- to take the place of < so I could post it and it wouldn't get interpreted wrong.  So the regex is supposed to capture everything after the start module comment and before the end module comment which works on my example page.

I think your's is not ending correctly and you are getting two viewstate fields on your page and also two footers. 
That would be why you get an error on the page that did the capture.

I started answering your other questions yesterday, but I must have been distracted before I posted and closed the window (Working with tabbed windows can be dangerous).

The webcapture is part of Replacements, so as long as you don't exclude that it should still be executed.
The caching you are seeing may be happening on the source page instead of at the target.
Yes, the Page Rules are executed in order, so you can do more cleanup after the capture if needed.

I'm not sure what you are using for your capturing Regex, but if you want to attach it in a text file, I can try it out in Regex Buddy to see if it is working as expected.

 

 

 

 

 

DavidWSnow
<250Posts
Posts:162


04/29/2008 12:29 PM  
We really need a better way to post rules. Active Forum truly gets in the way! Maybe you could lean on its developer and see if he can include some easy way to quote HTML so that it displays correctly. Sort of that maybe we should both all rules as attached text files. I missed that you had the Started and end in an html comment because of the crap you were doing to try to fool Active Forum into displaying it and added extra comment characters.

/Dave
Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > External Content question WebCapture



ActiveForums 3.7
Powered by: Snapsis Software