Hi there,
I am new to Serendipity. I just moved my photoblog from WordPress to Serendipity and I am fairly happy with the results. I have been spending a good amount of time configuring templates and modifying the photoblog plugins (event and plugin, which are very simple in functionality).
the current result is here: http://turingmachine.org
I have some questions regarding its configuration (I am able to write PHP if needed).
* I want to show in the main page (index.php) only one posting, the most recent, but in any othe r page (search results, category listings, etc) to show a larger number of entries, for example 10. Can anybody point me in the right direction?
* In any page that lists more than one entry I would like to show an thumbnail of the photograph, instead of the entire photo. And then if the user clicks in the photo, then the page for that entry is displayed. What would be a good place to start to implement/configure this feature?
Photoblog, how to implement certain features?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Photoblog, how to implement certain features?
Hm, I can't see a photoblog on that site?
Anyways, did you also have a look at the "imageselectorplus" plugin? ("Extended options for media manager") - That one requires Serendipity 0.9, but then allows to create a "quickblog" entry when you upload an image. I am personally not using a photoblog or the photoblog plugins, though. Maybe they're alread good suited for your use.
That would be the "GUI-version". If you want to hack it in yourself, it's also not that hard:
1. Open your include/genpage.inc.php file
2. Locate this code:
Before that code you add this:
This will effectively change the fetchLimit.
I'd suggest to put the thumbnail version in the usual body, and put the large image into the "extended" part of an entry.
Then in your entries.tpl Smarty Template you could check if the $serendipity['fetchLimit'] is set to 1 or 10, and depending on that either display only the extended part of the entry, or only the body part of the entry.
To actually make a Smarty check on the fetchLimit variable you need to assign the variable to your template. The easiest way is to create a "config.inc.php" file in your template directory with this content:
Now you can use this HTML in your entries.tpl:
HTH,
garvin
Anyways, did you also have a look at the "imageselectorplus" plugin? ("Extended options for media manager") - That one requires Serendipity 0.9, but then allows to create a "quickblog" entry when you upload an image. I am personally not using a photoblog or the photoblog plugins, though. Maybe they're alread good suited for your use.
That's actually easy to do if you use Serendipity 0.9 and the plugin "Properties/Templates of Categories". You can then set the global "Entries to display" amount from 15 to 1. Then use the category plugin to edit each category and then there set the "entries to display" to 10, or so.* I want to show in the main page (index.php) only one posting, the most recent, but in any othe r page (search results, category listings, etc) to show a larger number of entries, for example 10. Can anybody point me in the right direction?
That would be the "GUI-version". If you want to hack it in yourself, it's also not that hard:
1. Open your include/genpage.inc.php file
2. Locate this code:
Code: Select all
// For advanced usage, we allow template authors to create a file 'config.inc.php' where they can
// setup custom smarty variables, modifiers etc. to use in their templates.
@include_once $serendipity['smarty']->template_dir . '/config.inc.php';
Code: Select all
if (!empty($serendipity['GET']['category'])) {
$serendipity['fetchLimit'] = 10;
} else {
$serendipity['fetchLimit'] = 1;
}
Hhhm. This is a bit harder to achieve. How are you placing the thumbnails of the photo? Via one of the photoblog plugins? Does the HTML for the photo get added to the entry body, or is it stored seperately? As I'm not using the plugin, I don't know this on my own...* In any page that lists more than one entry I would like to show an thumbnail of the photograph, instead of the entire photo. And then if the user clicks in the photo, then the page for that entry is displayed. What would be a good place to start to implement/configure this feature?
I'd suggest to put the thumbnail version in the usual body, and put the large image into the "extended" part of an entry.
Then in your entries.tpl Smarty Template you could check if the $serendipity['fetchLimit'] is set to 1 or 10, and depending on that either display only the extended part of the entry, or only the body part of the entry.
To actually make a Smarty check on the fetchLimit variable you need to assign the variable to your template. The easiest way is to create a "config.inc.php" file in your template directory with this content:
Code: Select all
<?php
$serendipity['smarty']->assign('fetchLimit', $serendipity['fetchLimit']);
?>
Code: Select all
{if $fetchLimit == 1}
Single: {$entry.body}
{else}
Full: {$entry.extended}
{/if}
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/
# 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/
-
Guest
Re: Photoblog, how to implement certain features?
Oh, sorry, it is http://silvernegative.comgarvinhicking wrote:Hm, I can't see a photoblog on that site
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Photoblog, how to implement certain features?
Wow. Awesome fotos!
Regards,
Garvin
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/
# 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/