[pmwiki-users] Galleria

DaveG pmwiki at solidgone.com
Sat Jun 11 09:06:33 CDT 2011



On 6/11/2011 8:41 AM, Petko Yotov wrote:
> 1. When your image is in a bulletted list, the "| Caption" part is not
> converted to "<br/>Caption" and the image is not wrapped in a div.
In my testing the caption is translated to <br/>Caption (ref the last 
demo on the page http://wiki.solidgone.org/Galleria/Demo8). Since that's 
being handled by PmWiki, it should be consistent. Not too important for 
this case though given the solution of styling the caption you noted.


> Tell your
> users to wrap the Caption with (for example) double apostrophes which PmWiki
> uses for italics/emphasized text, and jQuery can easily identify.
Excellent point -- solves the selector issue.


> 2. I don't need the (:galleria list=#section:) markup if I use one CSS class
> "Galleria", and let the library find all such blocks automatically:
>
>>> Galleria<<
> * Attach:Im1.jpg"Title1" | ''Some caption1, including %red% styles%%.''
> * Attach:Im2.jpg"Title2" | ''Some caption2, including %green% styles%%.''
>>> <<
> A 2nd Calleria will also work in the page, even without bulletted list.
>>> Galleria<<
> Attach:Im3.jpg"Title3" | ''Some caption3, including %red% styles%%.''
> Attach:Im4.jpg"Title4" | ''Some caption4, including %red% styles%%.''
>>> <<
Agreed, and I'll document that. As you note in your subsequent post 
though the markup provides a way to style each gallery.


> 3. Here is the javascript that goes to the HTML he	ader. I have it in
> config.php, you should adapt it for the recipe, probably allowing width and
> height to be configurable:
>
> $HTMLHeaderFmt['galleria-js'] = '<script type="text/javascript"
>    src="$PubDirUrl/galleria/galleria-1.2.3.js"></script>
> <script type="text/javascript"><!--
> $(document).ready(function(){
>    $(".Galleria").galleria({
>      width: 500,
>      height: 400,
>      dataConfig: function(img){
>        return { description: $(img).nextAll(\'em\').html() };
>      }
>    });
> });
> //--></script>';
>
> This snippet will take care of all Galleria blocks without the need to specify
> id=#demo etc., contrary to next(), nextAll() finds the 'em' element even after
> a<br/>  break.
Thanks. My stumbling block was getting jquery to select textnodes. 
Adding styling avoids that issue.


> This works, I'll leave it to you to incorporate it in your recipe, if you
> wish. :-)
Thanks for the help.


  ~ ~ Dave



More information about the pmwiki-users mailing list