nspages
nspages copied to clipboard
number of column (nbCol) always at 3 if usePictures is used.
this works
<nspages
demo
-nbCol 5
>
this doesnt
<nspages
demo
-usePictures
-nbCol 5
>
both if nbCol is set to higher or lower number.
just want to thanks you for the great front page for my wiki!
nspages 🚀
Thanks for this bug report.
Indeed, the usePictures
option completely does not take the nbCol
option into account (Ias can be seen on https://github.com/gturri/nspages/blob/master/syntax.php#L202 )
I don't remember why I implemented it that way. I'll try to look into it
So, the explanation is... that there are no columns at all.
Actually it's just a list of images, one after the other. Say you have pages A1
, A2
, B1
, B2
, and C1
. With the default output it would be displayed like this
A1 B1 C1
A2 B2
but with images it's just
A1 A2 B1 B2 C1
and when it doesn't fit on a same line, the browser displays them like
A1 A2 B1
B2 C1
but if your template is less wide, then it could well be displayed like this:
A1 A2
B1 B2
C1
Long story short: the code which displays images is completely not manipulating columns at all. From a theoretical point of view, this component could be rewritten to display columns, but that would be not so trivial in itself, and it might lead to displaying pages which may be hard to render on e.g. mobile devices.
Something which may fit your needs could perhaps be adding an option like picturesRatio
which could be used to reduce the size of the images (e.g. <nspages -usePictures -picturesRatio=0.5>
to have images twice as small). Let me know if it might suit you. If it does, I could try to do it (but I don't know how long it would take, given that I'm more a backend developer, and this feature would rather involve front-end skills)
thank you gturri, for the time you put into this.