MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Formatting Text (http://forums.pti.com/forumdisplay.php?f=32)
-   -   Horizontal Alignment Formatting Rule (http://forums.pti.com/showthread.php?t=4311)

Ryan_B August 21st, 2015 12:05 PM

Horizontal Alignment Formatting Rule
 
2 Attachment(s)
I'm getting some strange behavior from a rule I have written, and I'm wondering if anybody can tell me why.
I have a business card that allows the user to upload a headshot. It is not required, so if the user decides not to upload one, I want to horizontally center align a textframe.
This is the rule I have written to do so:
Code:

if(Field("HeadShot") == "")
{
  return '<p quad=C>' + Rule("RuleNameToUpper");
}
else
{
  return Rule("RuleNameToUpper");
}

The rule RuleNameToUpper simply puts the Name field in all caps. I then inserted that rule into the textframe that I want to center align.

I've tested it and it works as expected, except for one part. If the user does not upload a headshot, the textframe center aligns, but the font size is decreased. I've tried conditionally setting the font size with:
Code:

<z newsize="32">
//this is as big as I can go before getting the "red bar of death" at the bottom of the textframe.

But I can't get it the same size as the font if the user does upload a headshot. Here's the strange part: The font size set for that text frame is 12, and fills the entire height of the text frame.

This is how it looks when the user does not upload a headshot.
Attachment 1297
This is how it looks when the user does upload a headshot.
Attachment 1296

I'm not sure how or why when the user does not upload a headshot, the font size decreases. Any ideas for a fix would be greatly appreciated.

step August 24th, 2015 06:26 AM

Re: Horizontal Alignment Formatting Rule
 
The paragraph tag by default starts a new paragraph. In other words, adds a break. Making this small modification should resolve your issue:
Code:

if(Field("HeadShot") == "")
{
  return '<p br=false quad=C>' + Rule("RuleNameToUpper");
}
else
{
  return Rule("RuleNameToUpper");
}


Ryan_B August 24th, 2015 06:58 AM

Re: Horizontal Alignment Formatting Rule
 
Ah yes, this makes sense. I've made the addition and now it works like a charm! Thank you Ste for your reply.

step August 24th, 2015 07:03 AM

Re: Horizontal Alignment Formatting Rule
 
No problem! I'm glad I could help


All times are GMT -7. The time now is 01:01 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.