Jump to content

"Global Color Change" Option?


Summer

Recommended Posts

Good morning, I’m working on a slew of letterhead templates and I’ve run into an issue that I can’t figure out. :confused:

 

My customer is going to ultimately have the option of about 15 colors to choose from. I’m calling this their Accent Color and I want the choices to appear in a drop-down menu on the web form. These letterheads are going to be two-color for printing: one accent color and black.

 

Rather than setting up a Format Field in the Manager for every single variable for color choices, is there a way to apply the color choice "globally" across ALL variables within the template itself? Basically, since I'm dealing with multiple variables such as Address1, Address2, City, State, Zip, three to four Phone Numbers, Website, Email... I want to avoid having to assign a Format Field to every single variable on the web form in the Manager that the customers will access.

 

So let’s say the customer selects their accent color as dark green from a drop-down menu. Is there some kind of javascript code/rule that tells the template to change ALL variable text colors to dark green? I want to keep the web form as tidy and easy to navigate as possible for these people.

 

I’m also giving the customer multiple “phone title” choices such as phone, fax, cell, etc. I have to make Formatted Text Resources for these to function properly. If there IS in fact a color-switching rule that I can put in place within the template, do I have to make Text Resources for every single phone title, in every single color option for that rule to work properly? Any advice is much appreciate at this point, thank you!

Link to comment
Share on other sites

You can create a global variable (i.e. AccentColor) and pull it's value from (or based off of) the dropdown menu color choice.

 

For your template, you would just create rules to return all your content as tagged markup with the color tag referencing the global variable

(i.e. '<color name=\"' + AccentColor + '\">' + variable content + '</color>').

 

All pre-tagged content would pull the appropriate color value from the global assignment which would change per record or per job depending on the specific callback rule in which the necessary color was assigned.

 

I’m also giving the customer multiple “phone title” choices such as phone, fax, cell, etc. I have to make Formatted Text Resources for these to function properly. If there IS in fact a color-switching rule that I can put in place within the template, do I have to make Text Resources for every single phone title, in every single color option for that rule to work properly?

Assuming you regurgitate all your resources through rules which assign the color tags, you would not need to create multiple resources for each possible color.

 

Easy-peezy!

Link to comment
Share on other sites

Thanks for your comments Eric! Unfortunately I can't get that code you provided to me to work... I keep getting syntax errors. Can you check that string of code for me and repost it? I'm not familiar enough with the javascripting to know what's missing from the string to make it not function. It won't validate in FP.

 

I'm not too sure about the resources either... that might be tricky. I get the gist of what you're saying though, it's making sense to me. Any other help you can give me is greatly appreciated! Thank you. (I also work in prepress, the 'behind-the-scenes' of printing, so I'm still getting used to the language of the web/html. It differs greatly from the things I'm used to doing in my line of work!)

Link to comment
Share on other sites

Do you mean this code:

"<color name=\"" + AccentColor + "\">" + [i]variable content[/i] + "</color>"

I tried using single quotes in my OP, but replaced them with the standard double quotes in this repost. My code is not meant to be an all-inclusive solution, but rather a snippet of code to show an example of the direction you would move in. HTH. :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...