In editing entry_paging...

Creating and modifying plugins.
Post Reply
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

In editing entry_paging...

Post by wesley »

I'm trying to add another location for the links to the prev/next entry...
Since the current location is only limited to the top, I'm trying to add it
so that it comes at the end of the article.

The configuration and stuff are done. However, the said links don't show
up when I'm attempting to show it at the end of the article. This is how
it is coded in function event_hook:
case 'entry_display':
if ($bag->get('scrambles_true_content') && is_array($addData) && isset($addData['no_scramble'])) {
return true;
}

if (isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id'])) {
if ($placement == 'top' && !version_compare($serendipity['version'], '0.7.1', '>')) {
echo $this->showPaging($serendipity['GET']['id']);
} elseif ($placement == 'bottom') {
$eventData[0]['add_footer'] .= sprintf('</div>' . $this -> showPaging($serendipity['GET']['id']) . '<div>');
}
}

return true;
break;
$placement variable is used to retrieve configuration.

So I'm basically trying to get the links attached to $entry.add_footer in
entries.tpl. the </div><div> tags show up in the right place. However,
the links don't appear there, and end up showing up in $raw_data in
index.tpl instead. I don't know why they get separated and appear there.

Also, if I just use
echo $this->showPaging($serendipity['GET']['id']);
This also ends up in $raw_data.

Now, the page_nugget plugin uses $entry.add_footer as well and it has
no problems adding the nugget to the last part of the entry. I don't know
why the prev/next links can't be the same.
I make s9y plugins, too.
My s9y blog depends on them. :)
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Update on the problem:

I just made a workaround to the problem by just integrating the showPaging
function into the event_hook function. It seems to work fine this way. The
revised code will be committed a few hours later if there's no remedy to
the original problem.

EDIT: new version committed.
I make s9y plugins, too.
My s9y blog depends on them. :)
Post Reply