Question
Would anybody help me out to find how to conform SOMETHINGHERE in the line below?.
I have a page with a SEARCH variable in it. It shows data in columns extracted from different pages that match the search criteria. Those pages have an image. I want to include the image in one of the colums. I could go as far as the following
| | | <img src=%PUBURL%/%WEB%/$topic/SOMETHINGHERE /> | |
I would like to have a way to finish the line by using pattern and INCLUDE(\$topic and pattern variable, but I just get it partial results -with a lot of workarounds-.
FYI the application Iīm working on is a catalog of items, each item having its form for data entry and a photo. Eventually one can extract data from the catalog as well as photos, in a report that can be costumized for each need/user.
- TWiki version:01 Dec 2001
- Web server:Apache
- Server OS:Linux
- Web browser:IE6
- Client OS:WIN98
--
AntonioVega - 06 Nov 2002
Answer
This should not be too difficult. Make sure to name the attached images the same, e.g.
photo.jpg.
In the
FormattedSearch specify the image in the format, e.g.
format="| $topic: $formfield(Description) | %PUBURL%/%WEB%/$topic/photo.jpg |"
--
PeterThoeny - 09 Nov 2002
That will work if the name of the attached photo is "photo.jpg" in each different topic.
This will not be the case in a more general situation. I have tried to exttract the file name out of the meta information and place it instead of "photo.jpg" but somehow I canīt find the correct regular expresion as specified in
FormattedSearch. Also , I was expecting to display in the search result , by means of the propper regular expresion in
FormattedSearch , the specific attached file, among the ones uploaded, that correspont to a particular attachment comment that each different topic might have.
My workaround for that problem is to place an html comment tag and the name of the specific attached photo that I want to display in the search result by using
%PUBURL%/%WEB%/$topic/ForttamedSearchExpresionThatExtractTheInfoFromAnHTMLcommentTag
The idea it to have
%PUBURL%/%WEB%/$topic/ForttamedSearchExpresionThatExtractTheInfoFromTheMetaInformation
--
AntonioVega - 26 Nov 2002
A regex search on the first .jpg file in the meta date
would work if
SimplifyInternalMetaDataHandling is implemented. Currently it is not possible with TWiki internal commands since meta data is separate from the topic data, a regex will not find it.
As a workaround you can introduce a new tag in a Plugin, for example
%FIRSTATTACHEDIMAGE{ "Web.TopicName" }%. The variable gets expanded to the first image found in the topic based on an external grep. Insert that tag in your formatted search, e.g.
%FIRSTATTACHEDIMAGE{ "$web.$topic" }%
--
PeterThoeny - 26 Nov 2002