Menu

#8 Fix $descriptionTruncSize on ATOM

open
nobody
None
9
2007-01-13
2007-01-08
No

$descriptionTruncSize doesnt seems to work well with <content> and <summary> in ATOM will fix...

Discussion

  • mypapit wuz here (info@mypapit)

    • status: open --> closed
     
  • mypapit wuz here (info@mypapit)

    Logged In: YES
    user_id=458301
    Originator: YES

    fixed, now atom will only have summary when $descriptionTruncSize is set

     
  • KosherJava

    KosherJava - 2007-01-11

    Logged In: YES
    user_id=634811
    Originator: NO

    There seems to be a bug in this implementation this code wraps the <content> in a description call and will not render the content if descriptionTruncSize was set it should wrap the summary and not content in this check.
    This code used by PhpGedView generates a <summary> that is way more than the 500 specified, but generates no <content> (see snippet below). Maybe my understanding is flawed, but my thinking is that the summary should be a truncated version of the content, and that the content should not be truncated.
    $item = new FeedItem();
    $item->title = $upcomingEvent[0];
    $item->link = $SERVER_URL. "calendar.php?action=calendar";
    $item->description = $upcomingEvent[2];
    $item->descriptionTruncSize = 500;
    $item->descriptionHtmlSyndicated = true;
    $item->date = $upcomingEvent[1];
    $item->source = $SERVER_URL;
    $item->author = $author;
    $item->authorURL = $feed->link;
    $item->category = $pgv_lang["genealogy"];
    $feed->addItem($item);
    generates a descrip

    if (empty($this->items[$i]->descriptionTruncSize)) {
    $feed.= " <content". $temptype . ">". $tempdesc ."</content>\n";
    }

     
  • KosherJava

    KosherJava - 2007-01-11

    Logged In: YES
    user_id=634811
    Originator: NO

    I would have re-opened this, but do not have the rights to do that.

     
  • mypapit wuz here (info@mypapit)

    • status: closed --> open
     
  • mypapit wuz here (info@mypapit)

    Logged In: YES
    user_id=458301
    Originator: YES

    you're right, sorry i messed up lol. going to fix this bug, it should be summary not content that is truncated.

     
  • KosherJava

    KosherJava - 2007-01-11

    Logged In: YES
    user_id=634811
    Originator: NO

    Look at http://diveintomark.org/feed/ (feedvalidator guy) and notice that most HTML but not all are stripped from the summary. It is probably some code that turns <li> into <p> and line breaks into <br/>, so it is probably not some generic code we can do. Should the summary and content be set separately?

     
  • mypapit wuz here (info@mypapit)

    Logged In: YES
    user_id=458301
    Originator: YES

    Hi there,

    It seems that <content> in ATOM are meant to store more than mere text data.

    refer, http://www-128.ibm.com/developerworks/xml/library/x-atom10.html
    "Listing 6. A simple list of images using Atom 1.0"

    therefore, I decided to drop the <content> tags association with <summary>.
    This means RSS <description> and ATOM <summary> are comparable and will contain the same data ($description).

    I will add another method to handle <content> in ATOM, this method/variable will handle <content> attributes such as "type" and "src" to reflect the flexibility of the <content> tags :)

     
  • mypapit wuz here (info@mypapit)

    • priority: 5 --> 9
     
  • KosherJava

    KosherJava - 2007-01-14

    Logged In: YES
    user_id=634811
    Originator: NO

    if the content is set for an RSS feed will it just be ignored?

     
  • mypapit wuz here (info@mypapit)

    Logged In: YES
    user_id=458301
    Originator: YES

    unfortunately yes, because RSS has no equivalent tags :(

    from the published rss standard, <description> tag is comparable to atom <summary>. RSS has no tag to store news content.

     
  • mypapit wuz here (info@mypapit)

    Logged In: YES
    user_id=458301
    Originator: YES

    description, content, summary will not be truncated if
    $item->descriptionHtmlSyndicated = true;

    this is to ensure that no invalid html code generated.

     
  • KosherJava

    KosherJava - 2007-01-18

    Logged In: YES
    user_id=634811
    Originator: NO

    makes sense, though it should be documented.

     

Log in to post a comment.

MongoDB Logo MongoDB