By Lyle B Hojbjerg Clarke
If you go to Mooloo's front page and take a look at the column on the right, you will see little camera icons beside some of the links. The camera icon means that the article being linked to contains a photograph.
If you already know about AQP's and know how to mix and match various macros to generate a page's content then this is really easy to do.
Firstly, the list of links itself is an AQP showing the latest articles. The results have been stripped down so that it only displays a link.
If you haven't done so already, to set up an AQP like this, go to the 'Results Settings' tab of the AQP (in the Site Structure Editor) and edit it as follows:
1. The Page Content Template just has the #queryResult macro,
2. The Query Result Template just has the #queryResultBody macro.
3. The Message Template just has a link using the #msgURL macro to generate the URL and the #MsgSubject macro to generate the actual text for the link.
The message template then uses a conditional macro that figures out whether or not the message has any enclosures. If there are enclosures, then it displays the camera icon, if there aren't any enclosures, then it does nothing.
It should look something like this:
#if condition="msg.enclosures.length != '0'"
the url of the image goes here
#endIf
That's all. You can insert the AQP anywhere you want (using the #insertquery macro)
NOTE: Also, just as a sidenote, you can enclose all sorts of documents to a message, but the above solution does not distinguish between the types of enclosed files, and thus shows a camera no matter what type of file is enclosed. As I only enclose images in the Mooloo conversation I have found using a camera icon fine, but if you use all sorts of different file types in your enclosures you may want to use a different, more general icon (for example a paper-clip).