show entries in sidebar - link to full entry text?

Creating and modifying plugins.
Post Reply
m2.ag
Regular
Posts: 22
Joined: Sat May 06, 2006 9:17 pm
Location: Hamburg
Contact:

show entries in sidebar - link to full entry text?

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: show entries in sidebar - link to full entry text?

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
m2.ag
Regular
Posts: 22
Joined: Sat May 06, 2006 9:17 pm
Location: Hamburg
Contact:

THank You, everything works :-)

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: THank You, everything works :-)

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
m2.ag
Regular
Posts: 22
Joined: Sat May 06, 2006 9:17 pm
Location: Hamburg
Contact:

sidebar_plugin_photoentry

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: sidebar_plugin_photoentry

Post by garvinhicking »

Hi!

good luck with that, please show off your results! :))

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply