speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
296 stars 36 forks source link

Can't use switch case on page margins #523

Closed Cicorione closed 1 year ago

Cicorione commented 1 year ago

Hi @pgundlach

I was unsure where posting this, I am concern that is another pebcak (99.99% it is a pebcak 😣).

I am trying to change the margin pages based on left and right, but it doesn't work they way I expect:

    <Pagetype name="allpages" test="true()">

        <!-- SWITCH CASE MARGINS  -->

        <Switch>
            <Case test="sd:even(sd:current-page())">
                <Margin left="15mm" right="20mm" top="20mm" bottom="20mm" />
            </Case>
            <Otherwise>
                <Margin left="20mm" right="15mm" top="20mm" bottom="20mm" />
            </Otherwise>
        </Switch>

Sure I can create two page types, but at this point this would come handy, but perhaps it can't work with margins.

Thanks 🙏

pgundlach commented 1 year ago

This is not implemented in the speedata Publisher, I am afraid. It could be implemented though.... Currently it is just a static evaluation, and there is no "current page" when the page type is defined.

Cicorione commented 1 year ago

I see, this is not a big deal, I am going to prepare two layout then, thanks as usual for you help! 🙏

p.s. anyway implementing wouldn't be a bad thing.