Quick Nav:  Online Store   |   Login | Register

Can't get multiple LoadFiles to work

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
Bruce Onder
<20 Posts
Posts:3


08/14/2007 2:05 AM  

Hi.  I am using a LoadFile tag in a portal replacement rule to do the following:

Search For:

Replace With: [RE:LoadFile("/DesktopModules/Snapsis/PageBlaster/thirdparty.txt")]

The thirdparty.txt file has some javascript and ends with a tag (there is another post to the effect that trying to put the tag in the replacement text directly doesn't work).

So for all but one of my pages, this solution works great!

However, on one page I need a second script block added to this one (ideally, between the script block above and the new closing body tag).

So I set up this page replacement:

Search For:

Replace With: [RE:LoadFile("/DesktopModules/Snapsis/PageBlaster/xrayrefi.txt")]

This text file has the second script block in it as well as another closing body tag.

However, try as I might, I can't get this second loadfile to work.  The first page loads fine (I can search for and find specific text from the file) but the second one does not (I can't find the specific text from that file).

Any idea on what might be wrong?

--Bruce

John Mitchell
Posts:3380


08/14/2007 10:12 AM  

Hi Bruce,

I will test this out today.  Thanks for reminding me about that other one too.

 

John Mitchell
Posts:3380


08/15/2007 12:22 AM  

Hi Bruce,

I was able to make this work on my development version which handles loadfile a little differently than the current released version.

I'm not sure what the tags are that you were searching for since those didn't come through in the post, but I did find the problem with searching for < /body> and then replacing with a file and the closing < /body>  tag.  The regular expression tries to replace the same thing again. What I did to work around it was to make the search tag different than the code that I replaced with.  Something like this:



SearchFor:   </body>\s+</html>
ReplaceWith: [RE:LoadFile(myfile.htm)]</body></html>

What the above code does is remove the whitespace between the closing body and closing html tag in the replace so that the original SearchFor is no longer there.

I was also able to "chain" them together by placing a different tag in the replacewith of the fiorst rule so that my second rule could find that and replace it with a file.



RuleName: 1st File
SearchFor:   </body>\s+</html>
ReplaceWith: [RE:LoadFile(file1.htm)]~anotherfile~

RuleName: 2nd File
SearchFor:   ~anotherfile~
ReplaceWith: [RE:LoadFile(file2.htm)]</body></html>
If this doesn't work for you, then send me an e-mail and I'll send you my latest build to try out.
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 > Can't get multiple LoadFiles to work



ActiveForums 3.7
Powered by: Snapsis Software