Popups with Table Cells
Description
This override allows popups to be constructed using paragraphs from different table cells.
Contents
Problem
From Michael O'Neill via wwp-users:
I have a problem getting popup content to show how I want, and wonder if anyone else has been down this road. In a nutshell, I want to have popup content display the content of two cells in a table. I was able to do this in WWP2003, but can't get it working in ePublisher. Here's the information layout on the page: [Image with hotspots for popups] [subheading] [collapsed/drop down table] I've tried mapping popups via paragraph styles and via markers, but no matter what I do, the popup only displays the content in the leftmost cell of the table (it never displays the content of the right cell).
Working Solution
You can try this recipe to change how ePublisher calculates dropdown content inclusion. The meat of the trick is that you effectively ignore the table structure when calculating dropdowns.
Create an override for "Formats\Shared\common\behaviors\document.xsl".
- Search for the table template about line 350:
<xsl:template match="wwdoc:TableCell" mode="wwmode:behavior">
Eliminate the container for table cells, <wwbehaviors:TableCell>.
<xsl:template match="wwdoc:TableCell" mode="wwmode:behavior"> <xsl:param name="ParamTableCell" select="." /> <xsl:param name="ParamWIFFile" /> <xsl:param name="ParamTopLevel" /> <wwbehaviors:TableCell> <xsl:apply-templates select="$ParamTableCell/wwdoc:*" mode="wwmode:behavior"> <xsl:with-param name="ParamWIFFile" select="$ParamWIFFile" /> <xsl:with-param name="ParamTopLevel" select="false()" /> </xsl:apply-templates> </wwbehaviors:TableCell> </xsl:template>
- After the container for table cells has been removed, the template should look like this:
<xsl:template match="wwdoc:TableCell" mode="wwmode:behavior"> <xsl:param name="ParamTableCell" select="." /> <xsl:param name="ParamWIFFile" /> <xsl:param name="ParamTopLevel" /> <xsl:apply-templates select="$ParamTableCell/wwdoc:*" mode="wwmode:behavior"> <xsl:with-param name="ParamWIFFile" select="$ParamWIFFile" /> <xsl:with-param name="ParamTopLevel" select="false()" /> </xsl:apply-templates> </xsl:template>
- Convert away!
Now, ePublisher will allow popup content to span across table cells. Can be misused, but handy if that's really what you want.
Example Project
You can download a sample project, Popups.zip for use with 2009.3 or 2009.4. It includes sample output both for the standard popup behavior and the table cell popup behavior. This is controlled via two separate targets. The customization has been added at the target level. Sources in FrameMaker 7.2.
Original, Incorrect Solution with Feedback
You can try this recipe to change how ePublisher calculates dropdown content inclusion. The meat of the trick is that you effectively ignore the table structure when calculating dropdowns.
Create an override for "Formats\Shared\common\behaviors\document.xsl".
- Search for the table template about line 112:
<xsl:template match="wwdoc:Table" mode="wwmode:behavior">
- Near the bottom, you'll see a section where it emits table behavior information and then process child paragraphs (cells, etc.)
<!-- Table --> <!-- --> <wwbehaviors:Table id="{$ParamTable/@id}"> <xsl:if test="$ParamTopLevel"> <xsl:attribute name="documentposition"> <xsl:value-of select="position()" /> </xsl:attribute> <xsl:attribute name="splitpriority"> <xsl:value-of select="$VarSplitPriority" /> </xsl:attribute> </xsl:if> <xsl:apply-templates select="$ParamTable/wwdoc:*" mode="wwmode:behavior"> <xsl:with-param name="ParamWIFFile" select="$ParamWIFFile" /> <xsl:with-param name="ParamTopLevel" select="false()" /> </xsl:apply-templates> </wwbehaviors:Table>
- Move processing of child paragraphs (cells, etc.) outside of the table:
<!-- Table --> <!-- --> <wwbehaviors:Table id="{$ParamTable/@id}"> <xsl:if test="$ParamTopLevel"> <xsl:attribute name="documentposition"> <xsl:value-of select="position()" /> </xsl:attribute> <xsl:attribute name="splitpriority"> <xsl:value-of select="$VarSplitPriority" /> </xsl:attribute> </xsl:if> </wwbehaviors:Table> <xsl:apply-templates select="$ParamTable/wwdoc:*" mode="wwmode:behavior"> <xsl:with-param name="ParamWIFFile" select="$ParamWIFFile" /> <xsl:with-param name="ParamTopLevel" select="false()" /> </xsl:apply-templates>
- Convert away!
Now, ePublisher will allow popup content to span across table cells. Can be misused, but handy if that's really what you want.
---
Michael writes:
I tried out your suggestion. The only thing it appeared to do is prevent popups entirely. Am I missing something?