Is there a way to allow multiple user to each have their own blog? How could this be set up?
One of the techniques to get multiple user blogs is to copy the content of the Main page and add a little sql in the query to retrieve blog articles in the macro. For this you need to copy the Macro code from xwiki.com in your own wiki: http://www.xwiki.com/xwiki/bin/view/Blog/Macros?xpage=code And modify the following lines: #if($category=='') #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") #else #set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate desc") #end For example you can add doc.web='$doc.web' in the queries #set ($sql = ", BaseObject as obj where doc.web='$doc.web' obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") This would have the effect of restricting the articles to the ones in the current space.. Be carefull this will probably break the home page blog as the home page blog is on Main.WebHome and the articles are in the Blog space.. You will need to add some ifs for the case #if($doc.web='Main') #set($articlespace = 'Blog') #else #set($articlespace= $doc.web) #end #set ($sql = ", BaseObject as obj where doc.web='$articlespace' obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") You can put the home page script of each user in the shared page and include it using #includeForm(). And the next cool thing would be to have a small script where people can setup their blog using one click ! Another approach is to say that a user blog is a blog of all the articles published by that user.. So that would be: #if($request.user) #set($usersql = "doc.creator = 'XWiki.${request.user}' and") #else #set($usersql = "") #end #set ($sql = ", BaseObject as obj where $usersql obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") You can view a user's blog by adding ?user=LudovicDubost Ludovic mlichman@partners.org wrote:
Is there a way to allow multiple user to each have their own blog? How could this be set up?
------------------------------------------------------------------------
-- You receive this message as a subscriber of the xwiki-users@objectweb.org mailing list. To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
participants (2)
-
Ludovic Dubost -
mlichman@partners.org