Search/Replace Code Reverts after Save

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
JenniferR
Propeller Head
Posts: 76
Joined: Tue May 12, 2009 2:07 pm
Location: California's Central Valley

Search/Replace Code Reverts after Save

Post by JenniferR »

I'm utterly stumped. My mission is to change all td styles in one topic using the Find and Replace feature in the text editor rather than going cell by cell in the XML editor. Originally, I was trying to save time, but I think I've wasted more time trying to figure this out than it would have taken me to tab thru each cell and apply the class. I'm so frustrated now that I am hell-bent on figuring this out.

What I've done is open the topic in the text editor. There are a couple of different td classes that need to be changed to "td.Larger". These are the existing td classes:
TableStyle_BasicCodes_Head_0_0_RowSep_ColSep
TableStyle_BasicCodes_Head_0_0_RowSep_ColEnd
TableStyle_BasicCodes_Body_1_0_RowSep_ColSep
TableStyle_BasicCodes_Body_1_0_RowSep_ColEnd

These are the steps I'm taking:
- Find one of the above td classes
- Replace it with td.Larger
- Save the project
- Repeat for the remaining 3 classes
- Look at the content in the XML editor
At this point, everything looks OK, so I look back at the text editor version (did this the first time because I was getting ready to close it) and all of the td classes are back to the way they were when I began. :(

What am I doing wrong?!

Hoping someone can help guide this feeble brain,
Jennifer

"Whenever you find yourself on the side of the majority, it is time to pause and reflect." -- Mark Twain
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Search/Replace Code Reverts after Save

Post by Nita Beck »

I'm guessing you have a table style (that is, class) applied to the table. Look at the <table> tag in the code. It probably is looking at the table stylesheet (a .css) that is being applied to the table. As long as that is being applied to the table tag, the table stylesheet is in play and it doesn't matter if you edit the code for the <td> tags.

I just tested this out. I applied a table stylesheet to a table and saved the topic. I then opened the code and manually changed all the <td class="somethingorothers"> to <td> and then saved and closed. I closed the topic in the XML editor and then re-opened it. Yep, all the <td>s reverted to the classes set by the table stylesheet that is being applied to the table.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Search/Replace Code Reverts after Save

Post by LTinker68 »

You're trying to override the styles from the table stylesheet. You can't just do a find-and-replace because any time Flare has to redraw the table, it reapplies the style names from the table stylesheet. I thought there was a way to override one of those cell styles using the "Cell Content Cell" option, but either that doesn't do what I thought it did, or it's not working right, because when I select that option, the only choice I get is to insert a paragraph instead of selecting an alternate td class. Maybe someone else can speak up about how to use that feature or if I'm misunderstanding what it's supposed to do.

There is a workaround if you want to change the classes for all the cells in one row (or column). This method doesn't work with changing one cell in a row or column -- it only works on the whole row (column). In the table stylesheet, create a new row (column) pattern, and set its Type to Custom. Set the attributes for that row as you want them (e.g., different background color). Save the table stylesheet. In the table in the topic, right-click on the <tr> tag on the left side of the XML Editor (if show tags is enabled) and select Row Style > {pattern name} from the popup menu that appears, where {pattern name} is the name you gave that custom pattern in the table stylesheet. So if you have your table stylesheet set to alternate rows with white and gray backgrounds, for example, you could create a custom pattern that has a background color of pale yellow, and use that custom pattern on a row in the table without it screwing up the alternating row color scheme of the rest of the table.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
JenniferR
Propeller Head
Posts: 76
Joined: Tue May 12, 2009 2:07 pm
Location: California's Central Valley

Re: Search/Replace Code Reverts after Save

Post by JenniferR »

Thank you for taking the time to explain this to me, Ladies.
I just needed to increase the font size for all text in the tables, but my brain was in a rut thinking that I needed to do that thru a style for text. I didn't even think of the TableStyle Editor, but once Lisa suggested it, I set the font size for the rows in there.

Once again, I was making it waaay more difficult than it needed to be.

Thank you for coming to my rescue. :D
Jennifer

"Whenever you find yourself on the side of the majority, it is time to pause and reflect." -- Mark Twain
Post Reply