cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

finding / reading forced table break PI's breakpenalty attr

naglists
1-Newbie

finding / reading forced table break PI's breakpenalty attr

My oid_fu is weak. I can make oid_name() return "_pi" but I can't read the
breakpenalty attr. Is it a pseudo attr? I only asked that to sound smart
because I still wouldn't be able to read it if I knew. LOL!

Ultimately, I want to highlight all <para> tags green in my screen FOSI if
they are in a row with a forced pagebreak. I have code that will do this in
red for row profiling by just checking on our profiling attrs on row. I'm
trying to write a system-func I'll call from para context entry that will
return "yes" if the row's first child is the forced table break PI.

Happy to pursue another path to indicate a forced break if someone has
found another way ...

--
Paul Nagai
2 REPLIES 2

Hi Paul--

Rather than trying to hack the table markup, I'd recommend using the custom table functions in ACL to check for this. For example, to get the breakpenalty for the row containing the caret, use something like this:

$oid = oid_caret();
$cell = tbl_oid_cell($oid);
$row = tbl_cell_row($cell);
tbl_obj_attr_get($row, "BREAK_PENALTY", $bp);
# the row break priority will now be stored in $bp

Note that this will tell you the name of the setting, rather than the numeric value you see if you view source on the PI.

Check the help center ACL reference. There's a whole slew of functions for doing stuff with tables, most of them start with "tbl_". You can search for "row table attributes" to find the topic that lists all the things you can ask for on a row object via tbl_obj_attr_get(). (There are similar lists for cells, columns, grids, etc., as well as a list of shared table attributes that all table objects have.)

I always try to do table work using these functions, because hacking the underlying table markup directly can sometimes be unpredictable and crash-prone.

If you really really want to examine the settings on the PI, use oid_content($pi_oid, 1) and parse the string.

--Clay

Duh. Thanks, Clay.



Top Tags