Creating a tiled overview of images

Introduction:
The company I work for is hosting a local XWiki (v2.1) to spread information to it’s employees. A part of this information is also about the clients of said company. Therefore I want to make a nice, tiled overview of all our client’s logos on an xwiki page, so our employees have a great overview of all our clients. If I click on the image, I want to go to the XWiki page of this client.

My question is:
How do I create a tiled overview of all of the clients logos?

What I have done so far:

  • I have tried making a table and inserting the clients’ logos in the table. This works, but it’ll make it really hard to keep the list alphabetical when new clients are inserted.

  • I was thinking about using the gallery macro, but I don’t know how to really use it. My knowledge in programming is limited.

Requirements:

  • The client must be renamed below the logo in plain text to ensure clarity.
  • All clients have to be sorted alphabetically
  • It must be easy to implement a new client in the list in the future
  • It must be possible to click on the image in order to go to the clients’ own XWiki.

You have a really old version of XWiki (2.1) so you can’t use the Gallery macro, but even if you could it doesn’t provide a tiled view.

You need to address two problems:

  • how to store the client information so that adding a new client doesn’t require updating the view
  • how to display the client information in a tiled view

For the first problem the solution is obviously to use structured data. Since you have an old version of XWiki you can’t use App Within Minutes but you can follow the http://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/FAQTutorial/FAQTutorialManual to create the structure for the client information.

Once you have this you can use the scripting API to query the list of clients and generate a table dynamically.

Hope this helps,
Marius

I’d say the first step is to upgrade to the latest XWiki version (it’s been 7 years since your version was released…).

Note that this community doesn’t support old versions of XWiki, see http://www.xwiki.org/xwiki/bin/view/Main/Support#HCommunitySupport

It’s already hard enough to support the new versions :slight_smile:

If you really need some support for old versions there are some companies offering that, see http://www.xwiki.org/xwiki/bin/view/Main/Support#HProfessionalSupport (they could even help you upgrade to a recent version too! :)).

Thanks for your reply!

For the version… I didn’t know how to check the version which the company I work for runs… I just assumed it’s 2.1 because the Xwiki hosts a syntax guide page for syntax 2.1 (I’m dumb…)

In the meantime I have looked at velocity and am now learning some basics. I used the xwiki.getVersion() method to find the version of our wiki and it’s 8.3. It’s already outdated but I don’t think that’s a problem now.

What I have managed to do so far:

  • Upload all the logos of the clients into attachments
  • Put all the attachments in a List (using $doc.getAttachmentList()),
  • Display all the logos underneath each other.

I wrote the code below:

{{velocity}}
#set($attachmentsList = $doc.getAttachmentList())
#foreach($attachment in $attachmentsList)
#set($image = $attachment.getFilename)
[[image:$image]]
#end
{{/velocity}}

Now I need to still figure out some other things:

  • How to couple the link of our Clients wiki to the logo.
    – For this I was thinking to not use the $doc.getAttachmentList() method but to put the names of all the logos alphabetically in a list manually, and also do this for a list which holds the link to the clients’ Xwiki.
  • Sort The logos to the clients name alphabetically
    – I was thinking about doing this manually
  • Place the logos in a raster
    – I only managed to place the logos underneath each other. Still not in a raster. How can I do this?

ah no, that’s completely unrelated :slight_smile:

To check your version see https://www.xwiki.org/xwiki/bin/view/FAQ/How%20can%20I%20find%20the%20version%20of%20XWiki%20I'm%20running

Haha yeah I already found that out! Thanks for the reply :slight_smile:

So now I have the following:

{{velocity}}
## first, create a list holding all the logos of the suppliers. Think about the Order!
#set($supplierLogoList = [
‘Client1.png’,
‘Client2.png’,
‘Client3.png’,
‘Client4.png’
])

## Now, insert the name of the suppliers’ wiki. This must be exact and in the same order as the > list of the suppliers logos
## The standard is that every new name MUST start with a capital, just like every other word. Example: ‘Client One’
#set($supplierWikiList = [
‘Client One’,
‘Client Two’,
‘Client Three’,
‘Client Four’
])

## Now, this information can be combined and inserted into the WIKI syntax to create a table, > with linked logos and text.
#set($logoIterator = 0)
#set($columnIterator = 0)
#foreach($logo in $supplierLogoList)
|[[[[image:$logo||height=“50” style=“display: block; margin-left: auto; margin-right: > auto;”]]>>doc:Dashboard.Suppliers and manufacturers.Client One.WebHome]]
#end
{{/velocity}}

This does give me some logos, with links, alphabetically sorted.
Only thing missing is: The logos are placed underneath eachother. I want to have them in a nice raster of n (rows) x 3 (columns). I now I can use an iterator that iterates along the foreach loop, but I dunno how to make it so that the logos are placed next to eachother in the table, and not underneath.

@imdumb92 did you ever happen to get this working correctly?
We’re wanting to something similar.

Thanks