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:

Failed to include URL http://www.amazon.co.uk/gp/product/0764526413 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed)

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 someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-05-09 - HelenJohnstone
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.