This topic is locked

Need help with Cantonazations

8/1/2007 4:57:47 PM
PHPRunner General questions
D
DouglasB author

OK, it's been about a year since I thought about this stuff so I've forgotten everything Sergey once taught me! A couple of simple questions I can't find answers to.
In version 3.1 I've create a table view. I want to format the List Page and the View Page differently. On both pages I want a couple of fields to support HTML so I set the property to HTML. On the List Page though I want 2 of these field to be cantonated, but I can't seem to do that AND have HTML as a property. What am I missing?

Sergey Kornilov admin 8/2/2007

What is the Cantonization after all?

D
DouglasB author 8/3/2007

What is the Cantonization after all?


Sorry I did not explain myself clearly or correctly, let me try again.
I am using phpRunner 3.1
What I mean is that in Step 9 of 12 I set the Table Specific Settings to:
"Truncate large text fields (More...link)" is check yes

Characters to display is set to 40
To me this would mean that text fields with 40 or more charaters would be truncated with a more link. However in all the page views this is not the case. This appears to work if the field is just a plain text filed with no special properties assigned. When I set the property for a field to HTML though this no longer works. How do I create a text field that supports HTML and still use the "Truncate large text fields (More...link)" feature?

Sergey Kornilov admin 8/3/2007

You cannot.
If you truncate HTML field at certain position and break HTML formatting the whole page goes wrong.

D
DouglasB author 8/3/2007

You cannot.

If you truncate HTML field at certain position and break HTML formatting the whole page goes wrong.


That's what I thought. I was hoping you had found away around that problem <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=20166&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

Sergey Kornilov admin 8/4/2007

Douglas,
we'll definitely find a workaround - just need to finish more important stuff.

O
ombilicus 9/11/2007

Hi,
I use phprunner to build CMS's for use exclusively in Flash so HTML formatting is limited to BOLD AND ITALIC.

I would be willing to risk the script truncating the text on a html tag while still using RTE. I prefer not having the list page scroll indefinitely...

I couldn't figure out where in the processLargeText function I could bypass this.

Please let me know if and how I could do this.

Thanks.
Maybe a temporary workaround would be to strip all TAGS from the text string. That way we could set VIEW AS to blank instead of HTML but avoid seeing the tags written in the list page text area. Just an idea.

Alexey admin 9/13/2007

Hi,
you can use List page:After record processed event for this.

Here is the code:

global $keylink;

$field="YourField";

$table="YourTable";
if(strlen($data[$field])>GetNumberOfChars())

{

$value=substr($data[$field],0,GetNumberOfChars());

$value.=" <a href=# onClick=\"java script: pwin = window.open('',null,'height=300,width=400,status=yes,resizable=yes,toolbar=no,menubar=no,location

=no,left=150,top=200,scrollbars=yes');";

$value.=" pwin.location='".$table."_fulltext.php?field=".$field."&".$keylink."'; return false;\">"."More"." ...</a>";
$row[$col.$field."_value"] = $value;

}


Also you'll need to change this line in generated ..._fulltext.php to

$value=nl2br(htmlspecialchars($data[$field]));

this one:

$value=$data[$field];