Jump to content

Tabstop Rule


marcalew

Recommended Posts

This wasn't within a business card template, but is might help with the setup...

 

return '<p tabstops=0;900,Left,,;>' + '<t>' + Field("Name");

 

This would set tabs at 1/8" and left-justified, tabe once and place the "Name" field. Just be sure to check-on the "return as tagged text box" in the rule editor.

 

Good Luck

Link to comment
Share on other sites

Then I would do one of the two things. If nothing else is to go after the semicolons, use a separate box for these three entries and right justify that box. Or, if you want to code them within a box and have data to come after them, then use the same rule that I had but change the "Left" to a "Right" to right justify the tab rule.

return '<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>T:<t>' + Field("Name1") +
<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>D:<t>' + Field("Name2") +
<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>F:<t>' + Field("Name3") 

This should right justify the information at the first tabstop <t>, then it will continue on left justified after the second tabstop.

 

You may need to adjust the values of the tabstop points to meet your spacing requirements. Also, you also might want to code these individually and do one final return at the end of your rule. If for instance record one does not contain a value for D: and you want to suppress this. Try this

var tabSet = '<p tabstops=0;900,Right,,;1800,Left,,;>';
var codeT = "";
var codeD = "";
var codeF = "";
if (Field("Name1") != "")
  codeT = tabSet + '<t>T:<t>' + Field("Name1");
if (Field("Name2") != "")
  codeD = tabSet + '<t>D:<t>' + Field("Name2");
if (Field("Name3") != "")
  codeF = tabSet + '<t>F:<t>' + Field("Name3");

return codeT + codeD + codeF;

 

Good Luck.

Link to comment
Share on other sites

Sorry David, I'm following you around today! This is also an excellent suggestion:

Then I would do one of the two things. If nothing else is to go after the semicolons, use a separate box for these three entries and right justify that box. Or, if you want to code them within a box and have data to come after them, then use the same rule that I had but change the "Left" to a "Right" to right justify the tab rule.

return '<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>T:<t>' + Field("Name1") +
<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>D:<t>' + Field("Name2") +
<p tabstops=0;900,Right,,;1800,Left,,;>' + '<t>F:<t>' + Field("Name3") 

This should right justify the information at the first tabstop <t>, then it will continue on left justified after the second tabstop.

 

You may need to adjust the values of the tabstop points to meet your spacing requirements. Also, you also might want to code these individually and do one final return at the end of your rule.[/code]

<etc>

But I feel obligated to note that, if you're using FusionPro 4.1 or later, you don't need to generate <p tabstops=xxx> tags. That syntax is confusing and hard to get right. You can simply use the Edit Tab Stops dialog (click "Tabs..." from the Variable Text Editor) for the text frame in which you're using the rule to set the tab stops in the GUI, then you can simply use the <t> tag in your rule to insert the tab stops at the positions you've already defined in the editor.

 

Actually, for an application like this, you probably don't need any JavaScript rules at all. Just type everything in the Variable Text Editor, including the prefix, a tab (by hitting the Tab key on your keyboard), and the variable for each line of text, and then select everything, click "Paragraph...", click the "Suppress if" button and select "Containing Empty Variables", then click OK on the Paragraph Formatting dialog, and set your tab stops in the Edit Tab Stops dialog as I described above.

Link to comment
Share on other sites

  • 3 weeks later...

Very helpful thread but to add to the confusion... The business card I'm working with has a rule line to the left of the contact numbers (Direct:, Tel:, Fax:, Mobile:) Can anyone shed some light on how I can adjust the length of that rule line depending on the amount of fields being used?

 

Much appreciated.

Link to comment
Share on other sites

Very helpful thread but to add to the confusion... The business card I'm working with has a rule line to the left of the contact numbers (Direct:, Tel:, Fax:, Mobile:) Can anyone shed some light on how I can adjust the length of that rule line depending on the amount of fields being used?

If I understand what you're asking, you could put everything into a table with cell rulings only on the leftmost edge of the first cell in each row. Table columns are more "firm" than tab stops anyway.

 

P.S. In the Advanced mode editor, you can click "Disable smilies in text" to prevent the vBulletin software from helpfully converting things like :) into smiley-face icons.

Link to comment
Share on other sites

Hi Dan. Thanks for pointing me in the right direction. I've set up an external <table> file (columns, rows, cells.) But, from here, I'm at a loss. I can't seem to locate any documentation that explains how to implement a rule from the resource created. Any other help would be great.
Link to comment
Share on other sites

Hi Dan. Thanks for pointing me in the right direction. I've set up an external <table> file (columns, rows, cells.) But, from here, I'm at a loss. I can't seem to locate any documentation that explains how to implement a rule from the resource created. Any other help would be great.

Well, there are a few ways you could do this. If you already have the table defined in a tagged markup resource file, you can use <variable name=XXX> tags in the markup, which can reference fields and rules in the job. Or, you could generate all the table markup in a rule and call the Field function as needed.

 

You might want to start a new thread specific to the problem you're trying to solve, since this isn't really about tab stops anymore.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...