Ryan_B Posted August 21, 2015 Share Posted August 21, 2015 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: 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: <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. This is how it looks when the user does upload a headshot. 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. Quote Link to comment Share on other sites More sharing options...
step Posted August 24, 2015 Share Posted August 24, 2015 The paragraph tag by default starts a new paragraph. In other words, adds a break. Making this small modification should resolve your issue: if(Field("HeadShot") == "") { return '<p [color="Red"]br=false[/color] quad=C>' + Rule("RuleNameToUpper"); } else { return Rule("RuleNameToUpper"); } Quote Link to comment Share on other sites More sharing options...
Ryan_B Posted August 24, 2015 Author Share Posted August 24, 2015 Ah yes, this makes sense. I've made the addition and now it works like a charm! Thank you Ste for your reply. Quote Link to comment Share on other sites More sharing options...
step Posted August 24, 2015 Share Posted August 24, 2015 No problem! I'm glad I could help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.