Tags:
create new tag
, view all tags

Question

I am trying to include an image from an external website into a page in the wiki.

I've set the appropriate Config flag to allow included URLs.

This line of code works:

%INCLUDE{raw="on" pattern="^.*?original_image\",[ ]*\"(.*?)\".*" "http://www.amazon.co.uk/gp/product/0764526413" }%

giving this:

51RDME3WKXL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU02_.jpg

BUT, put this into a SEARCH which looks for specific pages in the wiki which hold an ISBN as a meta data item, and it fails to work:

%SEARCH{"$" scope="topic" regex="on" nosearch="on" nototal="on" format="| %INCLUDE{raw="on" pattern="^.*?original_image\",[ ]*\"(.*?)\".*"  "http://www.amazon.co.uk/gp/product/$formfield(ISBN)"}% |" }%

I get " Failed to include URL http://www.amazon.co.uk/gp/product/0764526413". It gets the META ISBN data ok, but doesn't get the image.

If I replace '$formfield(ISBN)' with a real ISBN number, it works fine.

I've bashed my head against a wall for a long time on this. Can anyone help fix it?

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS: Windows XP
Web Browser: Firefix
Categories: Search

-- HelenJohnstone - 02 May 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

The INCLUDE fires off before the SEARCH. You need to delay it until after. Do that by escaping the % sign inside the format:
format="| $percntINCLUDE{ raw=\"on\" pattern=\"...\"}$percnt |"

-- PeterThoeny - 03 May 2008

Thanks Peter. Worked a treat. I got my escapes muddled up!

-- HelenJohnstone - 09 May 2008

 
Change status to:
Topic revision: r3 - 2008-05-09 - HelenJohnstone
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.