Quick Nav:  Online Store   |   Login | Register

Custom Replacement Tokens?

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
Will Strohl
<50 Posts
Posts:48


03/28/2008 2:00 PM  

Is it possible to add our own list of replacement tokens, from either XML or another datasource?

John Mitchell
Posts:2779


03/28/2008 2:04 PM  

Yes, you can define your own token that will be replaced and then use the LoadFile, or TransformXML, or WebCapture dynamic tokens to pull in external data.

Will Strohl
<50 Posts
Posts:48


03/28/2008 2:06 PM  

Do you have an example anywhere that we can use?  The documentation in that area look promising, but it sure would be nice to see an example.

John Mitchell
Posts:2779


03/28/2008 2:36 PM  

There is an example of LoadFile in the SavedRules. And you can also get the syntax from the drop-down list while editing a rule.

Basically, you would define your own token that will be searched for and replaced (or use something that is already in the output of the page).  So lets say you wanted to define your own token like {MyToken} and then use a webcapture of a dynamic lookup page called MyToken.aspx that is in the root of your website. 

SearchFor:

{MyToken}

ReplaceWith:
[RE:Webcapture("MyToken.aspx")]

Now you could have the MyToken.aspx file dynamically lookup anything you want to put in that custom token.

 

Will Strohl
<50 Posts
Posts:48


03/31/2008 9:37 AM  
Would this method work for AJAX-enabled implementations as well?
John Mitchell
Posts:2779


03/31/2008 11:17 AM  
I'm not sure what you mean. Are you saying you would want to use an Ajax request to replace your custom token in a page?
Will Strohl
<50 Posts
Posts:48


04/02/2008 7:47 AM  
The Ajax request might bring in text content from any datasource, and it may have tokens or other text that we might want to replace. Does this module cover that use-case?
John Mitchell
Posts:2779


04/02/2008 8:25 AM  
Not directly. Ajax requests are specifically avoided because they usually can not handle the Response Filter being added. This is because an Ajax response does not have a closing < /html tag which is required by PageBlaster to determine the end of the Reponse Buffer.

If you did want to allow your Ajax call to be processed by PageBlaster then it should work as long as you have the closing < /html tag in there.

However, what you could do is make your server-side Ajax code get it's content from another page that is being processed normally through PageBlaster.
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 > Custom Replacement Tokens?



ActiveForums 3.7
Powered by: Snapsis Software