Page 1 of 1
show entries in sidebar - link to full entry text?
Posted: Sat May 06, 2006 9:40 pm
by m2.ag
Hi,
just installed this very helpful plugin "
show entries in sidebar".
>> The Site:
http://www.trendquest.de
But I miss an important feature:
Just would like to
show the first lines and then
LINK to the full entry in the main-content.
A link at the bottom of the sidebar-entries-text is missing.
Tried to include this link by comparing some other plugin-codes that have links, but I am not a that good php-coder.
Has anyone already coded this additional feature?
Or: What do I have to add to the code to get this feature?
Thank you for your help!
Matthias
Re: show entries in sidebar - link to full entry text?
Posted: Sun May 07, 2006 1:08 pm
by garvinhicking
Hi!
Since the output of that plugin is smartified, you can just edit the plugin_showentries.tpl file.
Change it from this:
Code: Select all
{foreach from=$entries item="entry"}
{if $showtitle}
<div class="serendipity_showentry_title">
{$entry.title|escape}
</div>
{/if}
<div class="serendipity_showentry_body">
{$entry.body}
</div>
{if $showext}
<div class="serendipity_showentry_extended">
{$entry.extended}
</div>
{/if}
<div class="serendipity_showentry_separator"></div>
{/foreach}
To something like this:
Code: Select all
{foreach from=$entries item="entry"}
{if $showtitle}
<div class="serendipity_showentry_title">
<a href="{$entry.link}">{$entry.title|escape}</a>
</div>
{/if}
<div class="serendipity_showentry_body">
{$entry.body|@truncate:200:''}
</div>
{if $showext}
<div class="serendipity_showentry_extended">
{$entry.extended}
</div>
{/if}
<div class="serendipity_showentry_separator"></div>
{/foreach}
And you also need an updated version of the plugin from here:
http://nopaste.php-q.net/210519
The old one did not set the $entry['link'] variable, which is why you need that new version.
Regards,
Garvin
THank You, everything works :-)
Posted: Sun May 07, 2006 10:53 pm
by m2.ag
Hi Garvin,
thank you, everything works fine! :-)
Well, ... right about now I'm trying to make a copy of this plugin to use it as a kind of mini-photo-blog-thing.
the aim: to have some additional illustrative photographs to existing entries - the photos placed on the left sidebar.
...or is this stupid cause there is already such a plugin like this?
Regards from Hamburg
Matthias
Re: THank You, everything works :-)
Posted: Mon May 08, 2006 12:03 pm
by garvinhicking
Hi!
I think there is a photoblog sidebar plugin, which allows you to upload a picture that's shown there...but I guess that's not exactly what you were looking for. But creating such a thing should not be too hard; you could take the "serendipity_plugin_references" plugin as an example. This shows all links of an entry in the sidebar - you could modify it to instead show specific CustomFields of an entry, or pull data from a database...
HTH,
Garvin
sidebar_plugin_photoentry
Posted: Mon May 08, 2006 11:54 pm
by m2.ag
Hi,
thanks for the informations. I'll try to make that modification...
Hopefully I'll be having the "sidebar_plugin_photoentry" on Wednesday ;-)
Matthias
Re: sidebar_plugin_photoentry
Posted: Tue May 09, 2006 9:05 am
by garvinhicking
Hi!
good luck with that, please show off your results!

)
Regards,
Garvin