|
Summary: Structure in abstracts
Priority (1<5) = 3
Raised by: hal
Description:
People have asked for the ability to write more structure in the abstract text fields. At present, linebreaks are entered, but two linebreaks are shown as just one and not as a new paragraph. Possible solution on Eprints tech list 12may2005:
It’s easily worked around however by adding the a rendering parameter to the “abstract” field config in ArchiveMetadataFieldsConfig.pm: { name => “abstract”, input_rows => 10, type => “longtext”, render_single_value => sub
{
my( $session, $field, $value ) = @_;
my @paras = split( /\r\n\r\n|\r\r|\n\n/ , $value );
my $frag = $session→make_doc_fragment();
foreach( @paras )
{
my $p = $session→make_element(
“p”,
class=>$self→{name}.”_paragraph” );
$p→appendChild( $session→make_text( $_ ) );
$frag→appendChild( $p );
}
return $frag;
}
},
and restart apache and MAKE SURE IT WORKS,as i’ve just cut and pasted the code then run generate_abstracts to fix the ones which are wrong. [tested by two others with success] The “render” paramters only effect how a value is converted to XHTML, so they can
15aug2005: Seems like we cannot have both the present (linebreaks rendered as linebreaks) and 2 linebreaks rendered as paragraphs. Mail to Eprints tech. |
New IssueOpen IssuesOrganic Eprints Wiki
Based on PmWiki |