|
Cookbook /
Mini-TalkFor a new question, please add a new section at the top of this page. --Petko Link to page images are attached to?Is it possible to link to the page an image is attached to? mini:Posters/*_preview.png Would show a gallery of all poster previews and then link to each of the pages in the Poster group the preview images are attached to. Ideally, the title of the page would also be used as a caption. If you have per-group upload directories (this is the default setting for PmWiki), there is no way of knowing to which page a file was attached. It may be possible to create a PageList (which will list/link the pages in your Posters group) but you may need to indicate in each page which pictures are related to it. What is the content of your Posters pages (their wiki sources)? --Petko October 10, 2011, at 06:28 PM Thanks for this, Petko. I ended up hacking YAG a bit and got it to do what I wanted, more or less. --Jboy Is it possible to returning "false" or "0" or "" if no images are found?Hi Petko. let's say i have a Group with a GroupHeader (or GroupFooter) like so:
!! Image Gallery for {*$Name}
Mini:{*$Name}*.jpg
i'm discovering it would be nice if i could detect whether or not Mini will find and display any images so that a page with no associated images could then suppress the header of "Image Gallery for ThisPage" (or whatever other info). i'm imagining i could do something like this by wrapping the above in something akin to:
(:if !equal "Mini:{*$Name}*.jpg" "":)
!! Image Gallery for {*$Name}
Mini:{*$Name}*.jpg
(:ifend:)
is something like this in any way possible? thanks. overtones99 June 28, 2010, at 07:17 PM You may be able to use a custom conditional like Alternatively, you can enable and use the Title and text around the gallery feature like this: Picture name under Thumbnail & Automatic Link to new Page?I have hundreds of images in multiple galleries. i use "mini:*" tag to automatically create those galleries in my pages and it works great, this saves a lot of time! Hello - and sorry for the late reply. I am glad to hear that Mini saves you a lot of time. Unfortunately, the features you ask for are not implemented. Both are possible with ThumbList though, (1) is enabled by default, and (2) can be done with an ImageTemplate which contains the line Thanks again! works perfect for me! :) - Jack Lighbox tweaks???if i replace the bundled Lightbox javascript with a newer version it stops working in Pmwiki. so i am guessing you have tweaked the bundled Lightbox code Petko? if so, can you document the necessary changes? i ask because i am seeing some odd behavior of the Lightbox close link: it often responds to a click by moving a bit to the left and not closing the image overlay til a second click. anyone else see this? if not, what could i be doing wrong? tia!!! /dan - bang December 17, 2009, at 02:43 PM Yes, there are some changes for the script to work with the PmWiki's uploads, pub and css directories that need to be parameterizable and not hard-coded. Bigger problem is that the new Lightbox version uses a more recent Prototype release, and it will not work with the older ones. I'll try to find some time to upgrade all to the new version. --Petko December 19, 2009, at 03:59 AM Remote imagesHi Petko, I'd love to use Mini (or its bigger brother) to display thumbnails of external images. Any chance that we might see that in the future or on how to quickly achieve this? --destotelhorus? October 28, 2009, at 05:17 PM No, Mini is specifically designed to integrate with PmWiki uploads directories. WikiGallery and QDIG should be able to show thumbnails of pictures on the same server, even out of the PmWiki's uploads structure. I know no PHP online gallery creating thumbnails of pictures on remote servers. But Galleria may be what you want (JavaScript, which means that visitors download all images from the remote site and their browsers scale the pictures down, simulating thumbnails). --Petko October 29, 2009, at 06:58 PM
Yes, you can have a sub-directory per-page instead of per-group, see the variable Mini with autogenerated page navigation![]() Petko, is it possible to create something like on the picture, because I have over 100 pictures and want to separate them on different pages. Of course, I can do it with range but then I must generate the linking pages manully. Thanks for your answer -- MatthiasGünther September 27, 2009, at 8:30 AM Please look at How to slice a large Mini list into subpages. --Petko September 30, 2009, at 05:52 PM It's working perfect, thanks a lot -- MatthiasGünther October 05 , 2009, at 12:05 AM Now I have another question: Is it possible to add << and >> buttons in the perpages, so that the user can navigate to previous respectively next page like it is in ThumbList? --MatthiasGünther October 06 , 2009, at 12:07 AM Yes, with a different link function like Again, thousands thanks for your fast support, you are a real wiki-god for me :), hope I will be in the future as fast as you, if some are going to ask for additional features. --MatthiasGünther October 07 , 2009, at 00:45 AM Displaying pictures attached to more than one pagePetko, If I want to list specific images for display, and I need or want to specify the group.page/filename.jpg for each one, the images do not display. Is this a problem with the code, or with my comprehension? Thanks! -- TeganDowling September 13, 2009, at 12:25 PM You can display many pictures attached to another page with Lightbox not working when Mini is used in SideBarI'm having trouble using Mini with Lightbox in the SideBar. I want to display one or two thumbs in the SideBar, but when putting them in, Lightbox stops working, although the thumb shows up and they have the I am not sure why this happens, I'll have to find some time to review it. In the meantime, you can add the following in Thanks for the quick reply, it does work now. I'm guessing this is injecting the lightbox css code at anytime. --JK? August 29, 2009, at 06:04 AM
The problem comes from the way PmWiki processes a skin template, see PITS:01139 for details. Yes, the command injects the Lightbox library in all pages. --Petko September 13, 2009, at 02:12 PM Note: For Mini version 20110817 and newer, use this code instead: Return to the galleryWhen you click on a thumbnail, it opens the original image. Is there a function for clicking on the larger image to return to the gallery? - Ian MacGregor No, the readers have to use their browsers' Back button. However, the recipe can be used with Lightbox JavaScript, and it offers better usability. Try it with $Mini['EnableLightbox']=1; [1] --Petko July 13, 2008, at 12:24 AMLightbox sounds interesting and may be worth allowing javascript. I'll give Mini+Lightbox a try. - Ian MacGregor
Links to galleries
IPTC captionsIt is an exelent application, but it would be even better for me if the iptc caption field could be used. With this I could easily comment my pictures in Picassa, IrfanView; upload them as a batch and find those comments displayed when looking at the pictures online. Damien September 27, 2008, at 04:18 PM See this recipe. --Petko September 27, 2008, at 05:33 PM
Random Thanks and StuffI have been looking for a solution like this for such a long time. Thank you for such a wonderful work! -- JLuk, October 27, 2008 Thanks for your kind words! --Petko November 23, 2008, at 07:35 PM
Lightbox is not working for me.I have tried everything but Lightbox seems not to work with my pmwiki (i have the latest version). Maybe there are some bugs in the latest version of 2 december? I spent 2 hours trying to figure out whats wrong but i can't find anything. Maybe there is something wrong with the javascript because i can't see it in the page source code of my website. Here is part of my configuration file: $Mini['EnableLightbox'] = 1; $Mini['LbUrl'] = " Here is the part from mini.php: 'EnableLightbox' => 1, 'Px' => 150,'Quality' => 90, 'CropXPos' => 0.5, 'CropYPos' => 0.5, 'LbMaxH'=> 800,'LbMaxW'=> 800, I followed the documentation and placed mini.php in the cookbook directory and the lb directory in my /pub directory. But Lightbox just doesn't work. -- miranon?, 3 december 2008 Hi. First, you should not edit the mini.php file. All settings could be done in config.php and they automatically override the internal variables. This is part of the PmWiki Philosophy #5 -- easier to upgrade to a newer version of Mini. (Set $Mini['Px']=150; in config.php.) Second, I feel the problem comes from your line $Mini['LbUrl'] = " where the $FarmPubDirUrl variable may not yet exist; just remove the line. Other possible issue may be that you defined LbMaxH and LbMaxW, but your original pictures are larger than 800 px. If this doesn't help, is there a page I could look at? --Petko December 02, 2008, at 06:23 PM
Lightbox is now working. Thanks!
Hi Petko, everything is working now. I figured out that the reason was my template for pmwiki, i forgot to include the -><!--HTMLHeader-->. Now i have fixed it and everything is working fine. Thanks for your help and tips! Greetings, -- miranon, 3 december 2008
Troubleshooting tips for LightboxIf Lightbox is not working usually the problems are:
(Tips from Petko on the mailing list on 2010-03-08.) ² Uppercase extensionsGreat extension, very useful and really easy to use. Sorry. Uppercase extensions,as well as filenames with spaces, are not supported, and will not be. It is written in the documentation. If the first markup works, it may be a bug and you shouldn't rely on it, as the bug will be fixed. (The only filenames that should be expected to work with Mini are those that can be displayed inline with Attach:picture.jpg.) --Petko February 21, 2009, at 08:02 AM
I am still using pmwiki-2.1.27 on a Windows Server (that I do not administrate) and their Attach:PicTure.JPG forks fine. But if You tel me that it may be a bug and is not supported any more in the newer pmwiki versions I should inform my user to principally not use any Uppercase extensions any more. The problem is that often cameras use Uppercase extensions for the filenames and we use ftp-upload for photo galleries so that I can not prevent this based on the pmwiki upload mechanism. Georges Schutz? February 21, 2009, at 08:55 AM Right, on Windows, filenames are case-insensitive, but on most servers they are not: pic.JPG and pic.jpg can be different files. PmWiki officially supports only lowercase extensions, and if you upload your files via the ?action=upload link, they are renamed to acceptable filenames (lowercase extensions). I am considering adding a variable that will automatically rename existing files with unsupported names, to correct ones. --Petko February 21, 2009, at 09:14 AM
Could be a solution. Is there a possibility to scan for filename conformity in all side-specific uploads (in all upload directories)? I sow that their is a recipe RecentUploadsLog that I could perhaps use to regularly check the uploads. But does this only show files uploaded by ?action=upload or all files in the multiple upload directories? Georges Schutz? February 21, 2009, at 11:32 AM As of version 20090321, Mini can autorename existing files to the right filenames, as if you uploaded them via the ?action=upload. --Petko March 21, 2009, at 06:17 PM
a.jpg to c.jpgI'm running an architecture website (zapgun.pt) using PmWiki engine with a lot of your recipes & tips (Maxi, Mini, UnToggle...). We are grateful towards your work around here (I'm just looking for a beautiful postcard to send ;) Hi. I'm not sure I completely understand what you try to achieve. In your example page, you can use I didn't make myself clear: what I was asking was about some line that produces images From X To Y (using the abc dictionary index). For instance, I have 01.jpg 02.jpg 03.jpg (...) 50.jpg uploaded but I only want to display in thumbnails images from 05.jpg to 15.jpg; It was very useful, also, if we could use different combination of From>To like: You can add a custom function which slices the Mini set. See Mini_Range. --Petko June 10, 2009, at 11:18 AM Thanks, obrigado, merci & Много благодаря. This recipe will be very helpful to me. I didn't had time to test it properly, so, I will write my opinion about Mini Range in a few days. Concerning the chapter "Title and text around the gallery" in Mini Cookbook: Is it possible to have different titles, texts or tooltips for each thumb/frame in the same gallery?
Concerning the Mini Range recipe: It would be nice to have a crossed features with the command lines available in the mother Mini.
Other thing that I had noticed (but I'm sure that this one is about my inability to deal properly with a correct installation) is that in the local folder with different Group.php instead of the main config.php I can't deal with the Mini Range because of this error:
Fatal error: Cannot redeclare umini_range() in /home/zapgun/public_html/wiki/local/Blog.php on line 20
Print out a page with Mini imagesIs it possible to have a "print view" for printing out all Mini images in one page? --cg? 2009-12-18 You can click on the "Print" action link somewhere in the page. Like here. --Petko November 19, 2009, at 03:50 PM Not exactly what I need today -- time is going by since 2009 and requirements have changed. ;-) We have a bunch of screenshots and you can inspect them in detail by your Mini Cookbook. But people like to print this lets say 20 screenshots. Now I would like to say action print. But in difference to the normal page images should have a with of 100% on the page, also hidden images -- via comment -- they belong to this screenshot series should be displayed. --cg? 2011-02-16 You can display the large pictures when a visitor clicks on the "Print" action link. Add the following code to config.php. --Petko February 18, 2011, at 07:04 AM if($action=='print') {
$Mini['ImgFmt'] = '';
$Mini['LinkFmt'] = '<img src="%2$s" border="0"/>';
}
Amazing how easy some things are if you know the "magic code" -- Thanks a lot! There are two remaining questions 1) How is it possible to show also the titles in the page with action=print 2) How can I display images that are hidden in the defaul view eg via comments: Mini:test1.jpg"Titel Bild 1" >>comment<< Mini:test2.jpg"Titel Bild 2" Mini:test3.jpg"Titel Bild 3" >><< This code instead of the previous one should print all pictures, including those in comment blocks, and will show the title below each image. --Petko June 11, 2011, at 03:47 PM if($action=='print') {
$Mini['ImgFmt'] = '%2$s';
$Mini['LinkFmt'] = '<div><img src="%2$s" border="0"/><br/>%1$s</div>';
$WikiStyle['comment']['display'] = 'block';
}
Use tooltip titles for entire listHello - first, thanks for the great work. This is exactly precisely what I've been looking for. Now my question: I'd like to display a list of images in one lightbox gallery, and did this like: Mini:m1.jpg,m2.jpg,m3.jpg
Now, I'd like to additionally provide tooltip titles - to be displayed within the lightbox presentation. I tried Mini:m1.jpg"Description one",m2.jpg"Description two",m3.jpg"Description three"
but it doesn't work. Any ideas? I tried the above suggested: You can have Mini:1.jpg"Title 1" Mini:2.jpg"Title 2" Mini:3.jpg"Title 3"
but it results in the images not being displayed as a single gallery anymore (I'm using lightbox with parameter "2"). thank you again! Mike You are correct, this splits the gallery in a number of Mini sets. If you require both individual descriptions and prev-next slideshow, you have to use Lightbox mode 1. --Petko December 28, 2009, at 03:56 AM Detailed tooltip titles for individual files in a single "Mini set" are possible from version 20110811, use this format: Mini:[= file1.jpg"Title of file1" file2.jpg"Title of file2" file4.jpg file3.jpg file5.jpg"Title of file5" =] Petko August 11, 2011, at 02:37 AM Mini and MakeUploadNamePatternsThe Pacific Bulb Society wiki has the first character of uploaded picture file names capitalised. When pmwiki 2.2.6 allowed modifications to uploaded file names, I added:
'/^./e'=>'strtoupper("$0")'
to After a while we noticed that when a page display required a thumbnail to be created, the thumbnail was created but did not display - subsequent page displays working correctly. I've decided that this is because after creating the thumbnail, mini displays it via HandleDownload(), that function applies the MakeUploadNamePatterns to the thumbnail name, we end up with Th00---. I have fixed things by adding another file name mapping: '/^Th00---/e'=>'"th00---"' I suspect if I was better at regex I could sort things out with one expression. The general point is that additions to MakeUploadNamePatterns either have to skip thumbnails or must have no effect on thumbnails, for example forcing extensions to lower case is OK because thumbnails already have lower case extensions. --David Pilling Thanks for your report. You can use this search pattern to skip thumbnails: Good tip, using regex "negative lookaround". There's a catch with Indeed, in order to allow admins to remove or reorder the replacement patterns, the full array needs to be defined. I fixed the documentation at More thumbnail sizesGreat script, looks very promising. Featureset is more than enough for my needs. Haven't integrated it into my page yet. I have a question upfront: Is it somehow possible to create thumbsnails like with Thumbnails2? I'fd liek to have square areas (background maybe black, but tht's CSS stuff) where the thumbnail is resized to fit in this square. Currently (as I understood) it is only possible to fix the width or height of the thumbnail and the other dimension is calculated automatically. Something like setting a maximum dimension in height and width while keeping proportion and everything located within a square Box. (I hope you know what I mean). Maybe this can be realized by setting the crop to -1 or something like that. Klonk March 19, 2010, at 03:04 AM Settign crop to "-1" is not a too bad idea. [some stuff deleted, see below] I'm simply not sure how to realize squares with centered images. Maybe with CSS? Klonk OK, some bit more changes are necessary (I deleted the above), I got it working like I wanted it to have: add after line 234: $h1=$h;
$w1=$w;
if(($cx==-1) and ($cy==-1)){ #reduce imagesize to defined maximum, but keep proportion
if($w/$h > $W/$H) {
$w=round($h*$W/$H); }
else {
$h=round($w*$H/$W); }
}
and change a few lines later to: $tY = max(round(($h1-$h)/2), round(($h-$H)/2)); $tX = max(round(($w1-$w)/2), round(($w-$W)/2)); Would be great if you could implement these changes into your code. Klonk March 20, 2010, at 02:16 AM
I'll try to find some time to think if it is really necessary for many users. At the moment, you can have your own MiniCreate function overriding the existing one with such a code in a local config.php file:
function uMyMiniCreate($fpath,$mpath,$W,$H,$T,$idx) {
# copy here the modified function MiniCreate() from mini.php
}
$Mini['CreateFunction'] = 'uMyMiniCreate'; # override the default one
Then, Mini will call your modified function instead of the default one when a thumbnail needs to be created. --Petko March 20, 2010, at 03:40 AM Markup
|