PDA

View Full Version : Help with VPP in an export template



SteveZilla
Jul 11th, '04, 01:30 PM
To all the assembled HD users out there: I could use some help designing a portion of an export template that meshes with html. Specifically for a VPP listing. I have the "blank" html already created, I just need help intergrating the HD tags/containers into it.

Here's the portion of the html sheet that shows how I want to display a character's VPP. It uses CSS, so it shouldn't need any font tags. I don't know how this list reacts to html in a post, so I've changed all the "<>" to "{}".


{tr}
{td width="8%" align="center" valign="top"}{!--COST--}{/td}
{td width="3%" class="small" align="center"}&nbsp;{/td}
{td width="81%" align="left"}
{i}VPP name:{/i} Variable Power Pool (##) - Advantages & Limitations
(after calculating the Control cost, add it in with the Pool cost when
listing the total cost to the character on this sheet)
{table border="0" cellpadding="2" width="100%"}
{tr}
{td width="8%" class="gr-dk" align="center"}Real{br /}Cost{/td}
{td width="84%" class="gr-dk" align="center"}Power{/td}
{td width="8%" class="gr-dk" align="center"}END{br /}Cost{/td}
{/tr}

{tr}
{td width="8%" class="gr-rd" align="center" valign="top"}##{/td}
{td width="84%" class="gr-rd" align="left" valign="top"}{i}Name of
Power in the VPP:{/i} Power construction details (## Active
Points){/td}
{td width="8%" class="gr-rd" align="center" valign="top"}##{/td}
{/tr}

{tr}
{td width="8%" class="gr-rd" align="center" valign="top"}##{/td}
{td width="84%" class="gr-rd" align="left" valign="top"}{i}Name of
Power in the VPP:{/i} Power construction details (## Active
Points){/td}
{td width="8%" class="gr-rd" align="center" valign="top"}##{/td}
{/tr}

Etc., etc. for each power in the VPP...

{/table}
{/td}
{td width="8%" align="center" valign="top"}N/A{/td}
{/tr}

And I'd also like a blank line between a VPP and anything else, if there is anything else in the Powers section.

{tr}
{td width="8%" align="center"}&nbsp;{/td}
{td width="3%" class="small" align="center"}&nbsp;{/td}
{td width="81%" align="left"}&nbsp;{/td}
{td width="8%" align="center"}&nbsp;{/td}
{/tr}


Thanks for any and all assistance in this matter!

Simon
Jul 12th, '04, 03:16 AM
The structure you're looking for is a bit too complex for the straight export process (it wasn't designed to isolate Powers or abilities, it was designed to format the abilities during output). However, since you're using HTML, you can use JavaScript to accomplish the logic that the export tags are lacking.

Basically, setup a JavaScript variable to denote whether or notyou are working on a VPP. Use conditional statements (along with the export tags) and document.write() to output your HTML.

The conditional statements would be along the lines of:
IS_LIST
isVPP=false; //your JavaScript variable
IS_VPP
isVPP = true;
document.write([output your VPP stuff here]);
/IS_VPP
IS_MP
isVPP=false;
/IS_MP
IS_EC
isVPP=false;
/IS_EC
/IS_LIST
IS_NOT_LIST
IS_LIST_ITEM
if (isVPP) {
document.write([output your VPP item stuff here]);
}
/IS_LIST_ITEM
IS_NOT_LIST_ITEM
isVPP=false;
/IS_NOT_LIST_ITEM
/IS_NOT_LIST


You'll likely need to change the above to follow the specific logic that you're looking for, but that should be enough to get you started.