Copy link to clipboard
Copied
Is there a way to change the width of a CTA button to grow/contract with the amount of copy inside it when the copy is pulled from a data-set?
1 Correct answer
For Data driven graphics you would need to replace the text and the button or have text and button as an image the correct size. For Pixel replacement image there is some alignment options. It would nice if you could center justify text in a text paragraph layer that was button size so the text would be centered in a fixed size button.
It look lile you be able to at least center all your text in your button by keeping all text strings all the same length with spaces.
Explore related tutorials & articles
Copy link to clipboard
Copied
Please elaborate and post screenshots.
Copy link to clipboard
Copied
Call-to-Action?
Copy link to clipboard
Copied
We need a whole lot more information here about what you are doing. What is a CTA button and how are you getting text into it?
Copy link to clipboard
Copied
Apologies I just assumed a "Call to Action" button was a common expression. But it's just a simple button with text inside it. I am trying to find a solve for having the button resize it's width to accommodate the amount of copy inside it. I am importing data sets from an CSV file. Here's an example of a Rectangle shape, a dynamic text field (populated from the data merge), and a static Vector arrow shape.
Would anymore know of a script automate changing the Rectangle width based on the text length inside it so all iterations of the button would keep the same spacing as in the 1st image above?
Thanks!
Copy link to clipboard
Copied
This still doesn't help. Are you writing an application and creating buttons?
Copy link to clipboard
Copied
I am creating layouts with different sized buttons using Photoshop's "Data Driven Graphics" to export files with auto sized buttons. I am trying to get the button shape to resize dynamically.
It looks like this is possible in Illustrator by applying a "Fill Effect" in the Appearance window. I'm looking for a similar method in Photoshop.
Thanks!
Copy link to clipboard
Copied
There really isn't a way to specify bounds based on a text box.
Copy link to clipboard
Copied
I find the »explanations« unclear so far.
I cannot tell whether the text is Point Text or Paragraph Text and what the »button«/color field actually is (Shape Layer, pixel Layer, …) as of yet.
Copy link to clipboard
Copied
For Data driven graphics you would need to replace the text and the button or have text and button as an image the correct size. For Pixel replacement image there is some alignment options. It would nice if you could center justify text in a text paragraph layer that was button size so the text would be centered in a fixed size button.
It look lile you be able to at least center all your text in your button by keeping all text strings all the same length with spaces.
Copy link to clipboard
Copied
There isn't built in function for such thing. The only built in way I can imagine is using layer style applied to Type layer but... I can not imagine/figure out how to create such layer style.

