Page 5 of 5

Re: Timeline - a responsive, mobile first theme

Posted: Sat Oct 06, 2018 5:41 pm
by Don Chambers
Cleanblog assigns entry header images using this:

Code: Select all

    {if $view=="entry"}
        {if $entry.properties.entry_specific_header_image}
            <style type="text/css">.intro-header {ldelim}background-image: url('{$entry.properties.entry_specific_header_image}');{rdelim}</style>         
        {else}
            <style type="text/css">.intro-header {ldelim}background-image: url('{if $template_option.entry_default_header_image}{$template_option.entry_default_header_image}{else}{serendipity_getFile file="img/post-bg.jpg"}{/if}');{rdelim}</style> 
        {/if}
It says to use a defined image for that entry if it exists...
... otherwise use a defined default image for all posts....
... otherwise use the theme's default image for an entry/post.

Lets say you had a series of images in the folder /img/ named background1.jpg, background2.jpg, background3.jpb, background4.jpg, and background5.jpg.

instead of using the default background image from the theme, I THINK you could do this (untested):

Code: Select all

    {if $view=="entry"}
        {if $entry.properties.entry_specific_header_image}
            <style type="text/css">.intro-header {ldelim}background-image: url('{$entry.properties.entry_specific_header_image}');{rdelim}</style>         
        {elseif $template_option.entry_default_header_image}
            <style type="text/css">.intro-header {ldelim}background-image: url('{$template_option.entry_default_header_image};{rdelim}</style>
        {else}
            {assign var=random_id value=1|mt_rand:5}
            <style type="text/css">.intro-header {ldelim}background-image: url({serendipity_getFile file="img/background{$random_id}.jpg"}');{rdelim}</style>
        {/if}
And there could be a cleaner way to do it, but this is the first thing that came to mind.

Re: Timeline - a responsive, mobile first theme

Posted: Sun Oct 07, 2018 1:09 pm
by thh
sternchen wrote:
Thu Oct 04, 2018 12:10 am
My blog is mostly about photography and I'm linking to a SFPG (singe file php gallery) anyway, maybe flickr and instagram following.
Perhaps you may want to have a look at the Photo theme?

viewtopic.php?f=5&t=20044

Re: Timeline - a responsive, mobile first theme

Posted: Sun Oct 07, 2018 5:00 pm
by Don Chambers
Not sure the method above will work for retrieving the image... maybe this will:

Code: Select all

        {else}
            {assign var=random_id value=1|mt_rand:5}
            <style type="text/css">.intro-header {ldelim}background-image: url('{$serendipityHTTPPath}templates/{$template}/img/background{$random_id}.jpg');{rdelim}</style>
        {/if}

Re: Timeline - a responsive, mobile first theme

Posted: Tue Oct 09, 2018 7:52 pm
by sternchen
Hi Don,
thank you very much for that snippet of code. I've tried to include it last weekend but couldn't get it to run. Until now my skills are limited to css based changes like colors and fonts so I will have another try. Unfortunately I'm just able to work on my computer weekends so I will try again and with your second snippet next weekend.
Cheers, sternchen

@thh: I already had a look at the Photo theme but for some reason I don't like the style and I'm about to get confortable with Clean Blog.

Re: Timeline - a responsive, mobile first theme

Posted: Wed Oct 10, 2018 1:42 am
by Don Chambers
If your preference is the Timeline theme, but you want this banner behavior from Cleanblog, it should be possible. Otherwise it is just a matter of trial and error to get it to work. PM me if you need additional assistance.

Re: Timeline - a responsive, mobile first theme

Posted: Mon Oct 22, 2018 10:43 am
by Huhu
I run into trouble with the categories. While they work smoothly in another timeline installation, somehow categories are not rendered / addressed in a new installation of timeline, and I have no idea why that is so. Checked quite a bit ... can't imagine that this is a timeline-exclusive error, though.

viewtopic.php?f=3&t=24090

Re: Timeline - a responsive, mobile first theme

Posted: Mon Oct 22, 2018 8:18 pm
by Don Chambers
Your category problem does not appear to be related to the Timeline theme, but you can verify that by switching themes to 2k11 to see if the problem continues or is solved.

Re: Timeline - a responsive, mobile first theme

Posted: Tue Oct 23, 2018 8:36 am
by Huhu
Thanks. Indeed the problem persists also with other themes, so no relation to the theme there as it seems. Don't know why I didn't do that simple check before ...