Variables with Company Info

Description

I have some variables from markers and paragraphs that I'd like to include into the subject and body of the email. I have a work around where I added some Settings to companyinfo.fti. I can collect the data from there, but since the product name and version is in the Map file (I'm using DITA), I'd much rather get it from my source than some setting in my ePublisher project.

Can I collect page level variables during the company-info pipeline?

Attempt #1

Here are my edits to Formats\Shared\common\companyinfo\companyinfo_content.xsl that doesn't quite work:

At this moment, this returns the following:

I don't understand why the 'false' is there. What I want is the current value of the variable. Does 'false' mean that it is not yet defined? Do I need to move this code out of companyinfo_content.xsl and into something like pages.xsl? Or can I change the company-info pipeline order?

Feedback #1

Zoe, this looks great. The issue you're running into is that wwvars:<variable name> only works as a page replacement in Page.asp, not in your standard XSL.

So, how can you get the value you want?

Let's back track a bit.

Let's assume you have a marker style named "Select Attribute - product" and you've assigned a variable name to it, say "product". You can access this in Page.asp with:

That works because earlier, we created a page replacement:

That's the info you want to access, right?

Okay. So you can get at it, but you'll need to rearrange things a bit inside of "pages.xsl". The purpose of "pages.xsl" is to... generate your pages! It sets up all <wwpage:Condition>s and all <wwpage:Replacement>s so that we can render the Page.asp template. If you look inside there, you'll see that we create replacements as follows (this is based on Dynamic HTML, but other formats are similar):

Up top, you see your company info stuff being emitted and at the bottom, you see the variables being emitted. We'll need to change that. So, reorder them:

Now, the data you want/need can be accessed in $VarSplitGlobalVariables. Just what the heck is in that variable?

You can pull your product info out with:

The moded template, "wwmode:variable-string-value", lives in "variables.xsl" and is already loaded and ready to go inside of "pages.xsl".


Altogether, this should look something like this:

That should do it.

DevCenter/Projects/Variables with Company Info (last edited 2009-02-20 00:03:31 by BenAllums)