I guess all is in the title.

To be more accurate : I have 2 projects of books using PageFlip. For the first one, images are 640x720 (for scale = 1.0). I setuped the book size accordingly in the Megazine3 viewer parameters (under Book tag attributes).
But for the second book, pages are 510x720. Given the parameters I have in the Book tag attributes (640x720), it looks like Megazine module is trying to makes the 510x720 images fit in the book space, and thus enlarging them (510 to 640) at the expense of the ratio respect. And that is not what I'm looking for !
At the moment, I added background color on the right & left of each 510x720 images to have them size exactly 640x720, but I would like to avoid this trick...

Is there already a mean to do that, that I missed ? and if not, how to enable this feature ?

CommentFileSizeAuthor
#4 xml_override_question.txt854 bytesfamilieforlaget

Comments

adamdicarlo’s picture

I'm not sure what you mean by "projects" of books -- different Drupal installations, or different types of books on one Drupal site?

PageFlip doesn't currently support different page sizes. The dimensions are currently hardcoded in.

However, the PageFlip MegaZine3 viewer uses standard Drupal theme hooks for generating the XML. So you could override pageflip/pageflip_mz3_viewer/pageflip-mz3-viewer-page-xml.tpl.php -- copy it to your theme directory, flush your cache, and hack away at your theme's copy of that template! Take a peek at the other .tpl.php files in the pageflip_mz3_viewer folder, too.

l_arbalette’s picture

Hello adamdicarlo,

Let me try to explain my need better.
I want to be able to have many books, with different sizes, on the same Drupal installation (and of course the same PageFlip module).
For example, I want to have a book node showing a 640x720 book, with 640x720 pages inside.
But I also want to have another book node, showing a 720x540 book, with 720x540 pages inside.

From your message, I understood that pages size is hard coded... I went to the file you mentionned, and I understood that I would be able to change the size if I wish, but this size will then be used for all books & pages nodes.

Without changing these values, I managed to have a book with the desired dimensions, by :
-> setting up pageheight and pagewidth parameters under Book tag attributes (Megazine3 viewer configuration)
-> overriding the XML ouput of each page (using the appropriate field under each edit page node), giving the appropriate value for my pages size.
here is the example : test book 720x540

But I still have my issue : if I want to create another book, with other dimensions : I know how to override the pages size (by overriding the XML output, even if it is not very convenient)
but the book size is still "high level" defined by the parameters I put in the Book tag attributes, and if I leave this empty, it seems to be using the values in pageflip-mz3-viewer-page-xml.tpl.php. In both case, I cannot manage different dimensions for the books.

I understand that playing with the file that I should copy I don't know where in my drupal theme's directory, and doing I don't know what, it should be easier for me....
to be honest, I'm a complete n00b on Drupal, Drupal theming, PHP...I really did not understood a single word from what you said...if you can, I would really appreciate your knowledge ! (is sounds like it could help me to achieve the same result without all these workarounds, so I'm very interested in ! anyway, should we have these parameters enabled at the book and page edit node level, it could be great)

So, 1) would it be possible to manage this dimensions, for example at the book node level for the book size ?
2) would it be possible to have a set of parameter at the page node level as well, to override the pageheight and pagewidth values, without beeing compelled whether to play with the XML output, or the values in pageflip-mz3-viewer-page-xml.tpl.php, on the theme thing ?

familieforlaget’s picture

I got the same problem, maybe my problem is just, that I don't know how to override the xml for the book.

I have figuret it out on the pages, here I can use:

Only local images are allowed.
http://example.com/sites/default/files/pageflip/pages/frontcover_720.jpg
http://example.com/sites/default/files/pageflip/pages/frontcover_720.jpg
http://example.com/sites/default/files/pageflip/pages/frontcover_1080.jpg
http://example.com/sites/default/files/pageflip/pages/frontcover_1080.jpg

And then I have tried to overide the xml for the book with this code:

pageheight="720"
pagewidth="686"
bgcolor="0x498aa3"
zoommaxscale="2.0"
zoomminscale="0.5"
pagethickness="0.25"
plugins="overlays, links, titles, googleanalytics"
gaaccount="UA-15115112-1"
gatrackevent="buttonClicked,Outgoing,{url}">

print $content

But is till shows a book with the same width as I have placed in the global book attributes

familieforlaget’s picture

StatusFileSize
new854 bytes

Oh I can see that the code wont show. I will attach a txt

adamdicarlo’s picture

@familieforlaget: Sorry to say there isn't a way yet to override the book tag's attributes on a per-book basis without overriding the template pageflip-mz3-viewer-book-xml.tpl.php in your theme. It looks like that's what you were trying to do but you're having difficulty overriding the template? If so, make sure to flush caches after creating the template file, make sure the template file has the right name. You might need to add the template's hook_theme() info to your hook_theme() in your theme, too (I can't remember exactly when that is necessary in D6). If so:

function MYTHEME_theme() {
  return array(
    'pageflip_mz3_viewer_book_xml' => array(
      'arguments' => array('book' => NULL, 'chapters' => array()),
      'template' => 'pageflip-mz3-viewer-book-xml',
    ),
  );