Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Modifying blogholder content


Go to End


5 Posts   1987 Views

Avatar
feef

Community Member, 19 Posts

3 June 2010 at 7:20am

I'd like to modify the Blogholder page.

Either to display the latest blog entry in full.
Or
Display the latest entry in full, but leave the rest of the list of entries in their summerised format.

Alternatively, is it possible to change the navigation name of a virtual page? Then I could make a virtual page show the latest blog post in full, and turn the standard blogholder into a blog 'archive'.

The site is a work in progress:
http://kickingtyres.customer.vehentis.co.uk

I'm working on getting the blog content, image content and site structure sorted before I start populating the rest of the site or start playing with themes

tia

a

Avatar
Bruce B

Community Member, 164 Posts

3 June 2010 at 7:48pm

Try the following. It might give you a starting point.

Duplicate templates/include/BlogSummary.ss and rename it BlogFull.ss
In your new file replace $ParagraphSummary with $ParsedContent
In templates/Layout/BlogHolder.ss, change 'include BlogSummary' to 'include BlogFull'

Your new BlogHolder page should now display full entries rather than summaries. You can control the number by changing <% control BlogEntries %> to <% control BlogEntries(5) %> or whatever number you want.

good luck!

Avatar
feef

Community Member, 19 Posts

3 June 2010 at 8:10pm

That worked perfectly. Thanks!

Avatar
feef

Community Member, 19 Posts

3 June 2010 at 8:28pm

It works, but I've spotted a small issue with the links at the bottom.

It shows the complete blog post as I wanted, but the links at the bottom of the page (1234 Next) still operate as if it had been a summary listin and are, therefore, jumping 10 blogs each time that link is clicked.

I've found a reference to the BlogEntries.NextLink in BlogPagination.ss which creates the link, but can't find where the count of posts in each page is set.

It would be nice to have the link state the blogpost title of the preceding or following blogpost, but just a newer/older link would be fine.

Any pointers? Can't find the4se refernces in the code

Avatar
Bruce B

Community Member, 164 Posts

3 June 2010 at 9:24pm

You could add:
BlogTree::$default_entries_limit=5;
to your _config.php file
(I'm currently running SS 2.4 with Blog 0.4 so this may not apply to older versions)

but your problem is that your later pages are probably jumping by 10. Its just the first page that has a single entry. I thought I had an answer somewhere but it seems to have disappeared.