How to Set Blog (viewrecentblogposts.action) page as home page of a Space?

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2012

Hi everybody,

i'm using a space just for blog posting. I would like to set as Home Page of the space the page that i see when i click on browse and then Blog (viewrecentblogposts.action).

At the moment i'm using the blog post macro in the unique page of the space but i prefer how the (viewrecentblogposts.action) page looks, because it has categories of blog posts by month etc.

Any idea?

Thanks,

Kostas

1 answer

1 accepted

1 vote
Answer accepted
Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2012

Hi Kostas,

I'm not aware of a way of setting the home page of a space to viewrecentblogposts.action directly, but what you could do is:

1. Create a dummy page
2. Set that as the space home page via Browse -> Space Admin -> Home page
3. Use the Redirection Plugin to insert a {redirect} macro on the dummy page pointing to viewrecentblogposts.action

Hope that helps?

Andrew.

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2012

Hi Andrew,

the solution with the redirection plugin works fine. The problem is that i would like to have the viewrecentblogposts.action without all the tabs on the top of the screen. Basically my problem is that i don't have macros for the blog posts like search by month, search only blog posts etc. This functionalities are in the viewrecentblogposts.action page. Maybe i should check the viewrecentblogposts.action source.

Thanks a lot

Kostas

Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2012

Hi Kostas,

You can get close to the viewrecentblogposts.action page by creating a page that is 2 columns (60% and 40% width) with the blog-posts macro in the left hand 60% column and in the right hand 40% column a couple of instances of the recently-update macro showing updates for the last 31 days (one restricted to blog posts, one restricted to comments) with the search macro restricted to blogposts and possible the popular-labels macro.

I've knocked something up that does that, but it's hard to share now you can't copy and paste wiki markup in 4+. Does the above make sense?

Andrew.

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2012

All right,

i think i got it. I'll try it.

Thank you Andrew

Kostas

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2012

Hi Andrew,

i have followed the instructions from your blog (good work!) and it works fine.

Do you have any idea how to categorize the posts per month?

Thanx in advance

Kostas

Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2012

Hi Kostas,

Thanks for checking out the blog. Do you mean only displaying blog posts from the last month that have a particular label? You could do that with the "Restrict to these Labels" parameter documented at http://confluence.atlassian.com/display/DOC/Blog+Posts+Macro#BlogPostsMacro-Parameters

Or do you want something fancier?

Andrew.

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2012

Hi again Andrew,

No i didn't mean to categorize blogposts that have a particular label. Basically i'm trying to see how blogposts are categorized per month in viewrecentblogposts.action page. In viewrecentblogposts.action page, in the right column blogs are categorized per month. By default current month blogposts are displayed. You can choose previous months if you want.

Thanks for your time,

Kostas

Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2012

Ah, ok. Can't think of how to do that out of the box. Shouldn't be too difficuly to do that with a user macro though, I'll have a play and see if I can come up with something.

Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2012

Hi Kostas,

Sorry for the delay, try this User Macro:

## Macro title: List Blog Posts
## Macro has a body: Y or N (N)
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Andrew Frayling
## Date created: 13/04/2012
## Installed by: <your name>

## Macro to display blog posts for the current and previous months
## @noparams

#set ( $allBlogsInSpace = $pageManager.getBlogPosts($space, true) )

## get a calendar object for the current date
#set ( $currentDate = $action.dateFormatter.getCalendar() )

## Define an array of Month names
#set ( $monthArray = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] )

## set the current month
#set ( $currentMonthNum = $currentDate.get(2) )
#set ( $currentMonth = $monthArray.get($currentMonthNum) )

## Display posts for the current month
<h3>$currentMonth</h3>
#foreach($blog in $allBlogsInSpace)
  #if ($blog.getPostingMonth() == $currentMonth)
    #contentLink2($blog, true, false) $blog.getPostingDayOfMonth() $blog.getPostingMonth() $blog.getPostingYear()<br />
  #end
#end

## set the previous month
#set ( $previousMonthNum = $currentDate.get(2) - 1 )
#set ($previousMonth = $monthArray.get($previousMonthNum) )

## Display posts for the previous month
<h3>$previousMonth</h3>
#foreach($blog in $allBlogsInSpace)
  #if ($blog.getPostingMonth() == $previousMonth)
    #contentLink2($blog, true, false) $blog.getPostingDayOfMonth() $blog.getPostingMonth() $blog.getPostingYear()<br />
  #end
#end

It's not as fancy as the functionality on the viewrecentblogposts.action page, but it will list the blogs posted in the current month and the blogs posted in the previous month.

Hope it's of some help.

Andrew.

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2012

Hi Andrew,

Thanx a lot for you help. I have just installed your macro and works fine. I'm already using it.

Thanx again.

Kostas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events