Sunday, August 26, 2018

Re: [pcgen] CampaignHistory in outputsheet

 

Hi,

I fixed this up for the 6.07 series. Feel free to replicate the effort here for your own use, or download the latest version of pcgen to take advantage of the new code.

pdf - xml.ftl

        <campaign_histories>
            <@loop from=0 to=pcvar('count("CAMPAIGNHISTORY")-1') ; campaignhistory , campaignhistory_has_next>   
            <campaign_history>
                <campaign>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.CAMPAIGN')}</campaign>
                <adventure>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.ADVENTURE')}</adventure>
                <party>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.PARTY')}</party>
                <date>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.DATE')}</date>
                <xp>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.XP')}</xp>
                <gm>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.GM')}</gm>
                <text>${pcstring('CAMPAIGNHISTORY.VISIBLE.${campaignhistory}.TEXT')}</text>
            </campaign_history>
            </@loop>   
        </campaign_histories>

I don't know if I did the same treatment for the html pages. But the proof of concept is there, and you can use the freemarker code.

Cheers,

Andrew


On 8/26/2018 4:34 PM, sidious@swbell.net [pcgen] wrote:
My first post got eaten it looks like.

Anyway, trying to output campaign history to html.

I can manually do so by putting the individual entires in like:

${pcstring('CAMPAIGNHISTORY.VISIBLE.0.TEXT')}

...all fine and good.

However, the problem occurs if I want to create a loop using the count of campaign history entires.  Looks like it would work in a .LST file (http://pcgen.org/autobuilds/pcgen-docs/listfilepages/globalfilestagpages/globalfilesformulas.html#count), but the count token doesn't seem to work for outputsheets.  I tried the following:

pcvar('COUNT[CAMPAIGNHISTORY.VISIBLE]')
pcvar('COUNT[CAMPAIGNHISTORY]')

and
 
pcvar('COUNT[CLASSES]')
...as a "control" 

The last one (count of claseses) works, the other two always return zero.  That means I can't use them to create a loop to output all of my campaign history entries.


FYI, running 6.0.6

Thanks.


__._,_.___

Posted by: Andrew Maitland <drew0500@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

PCGen&#39;s Mailing Lists and Links: http://wiki.pcgen.org/Mailing_Lists_and_PCGen_Links

SPONSORED LINKS
.

__,_._,___

No comments:

Post a Comment