Timeline - a responsive, mobile first theme

Skinning and designing Serendipity (CSS, HTML, Smarty)
User avatar
Don Chambers
Regular
Posts: 3611
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Timeline - a responsive, mobile first theme

Post by Don Chambers » Sat Oct 06, 2018 5:41 pm

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.

thh
Regular
Posts: 232
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Timeline - a responsive, mobile first theme

Post by thh » Sun Oct 07, 2018 1:09 pm

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

User avatar
Don Chambers
Regular
Posts: 3611
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Timeline - a responsive, mobile first theme

Post by Don Chambers » Sun Oct 07, 2018 5:00 pm

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}

sternchen
Regular
Posts: 14
Joined: Tue Nov 04, 2014 10:19 am

Re: Timeline - a responsive, mobile first theme

Post by sternchen » Tue Oct 09, 2018 7:52 pm

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.

User avatar
Don Chambers
Regular
Posts: 3611
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Timeline - a responsive, mobile first theme

Post by Don Chambers » Wed Oct 10, 2018 1:42 am

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.

Huhu
Regular
Posts: 105
Joined: Tue Oct 04, 2011 3:22 pm

Re: Timeline - a responsive, mobile first theme

Post by Huhu » Mon Oct 22, 2018 10:43 am

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
Fan of post-apocalyptic Jugger: Free ebook on the sport

User avatar
Don Chambers
Regular
Posts: 3611
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: Timeline - a responsive, mobile first theme

Post by Don Chambers » Mon Oct 22, 2018 8:18 pm

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.

Huhu
Regular
Posts: 105
Joined: Tue Oct 04, 2011 3:22 pm

Re: Timeline - a responsive, mobile first theme

Post by Huhu » Tue Oct 23, 2018 8:36 am

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 ...
Fan of post-apocalyptic Jugger: Free ebook on the sport

Post Reply