Not sure if you're using the Panels app for your wiki, but if you are it's quite
easy. Here's a snippet from my own "Add Topic" panel:
##====
#set($sDocWeb=$doc.web)
##Only show the panel if it is logged in.
#if(false == $xwiki.getUserName($context.user, false).equals("XWikiGuest"))
#panelheader('Add Topic')
#if("Meetings" == $sDocWeb)
#set($g_sParentForTopics="Meetings.WebHome")
#set($g_sTemplateForTopics="Meetings.ArticleClassTemplate")
#set($g_sWebNameForTopics="Meetings")
#elseif("Sales" == $sDocWeb)
#set($g_sParentForTopics="Sales.WebHome")
#set($g_sTemplateForTopics="Sales.ArticleClassTemplate")
#set($g_sWebNameForTopics="Sales")
#else
#set($g_sParentForTopics="Main.WebHome")
#set($g_sTemplateForTopics="XWiki.ArticleClassTemplate")
#set($g_sWebNameForTopics="Main")
#end
#includeTopic("XWiki.XWikiCommonJavascript")
<form action="" id="newdoc">
<div class="padded centered">
<input type="hidden" name="parent"
value="${g_sParentForTopics}" />
<input type="hidden" name="template"
value="${g_sTemplateForTopics}" />
<input type="hidden" name="sheet" value="1" />
<input type="hidden" name="webname"
value="${g_sWebNameForTopics}"/>
<input type="hidden" name="name" value=""/>
<input type="text" name="title" value="Title"
class="panelinput" style="width:100px"
onfocus="if(this.value=='Title') this.value=''"
onblur="if(this.value=='') this.value='Title'"/>
<input type="button" class="button"
value="$msg.get("create")" onclick='if
(updateName(this.form.title,this.form.name)) { action="../../inline/" +
this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }'
/>
</div>
</form>
#panelfooter()
#end" panel:
##====
notes: Nope it's not perfect. It was thrown together in a rush, so there are bound to
be far better ways of doing this. Note that you can use a similar concept for a
navigation panel so you retain the ability to add categories, etc; as well as the
Blog.Macro document so that you have only one file to update to cahnge listing layout.
-----Original Message-----
From: Karin Wiklund [mailto:karin.wiklund@idainfront.se]
Sent: 11 July 2007 14:39
To: xwiki-users(a)objectweb.org
Subject: SV: SV: [xwiki-users] How to make a new blog
Thank you so much, both Erin and Vincent.
I have managed to get different spaces to display blog post of only their own space,
however I can't make blog entries in any other spaces than the original blog space.
(lucky me there are entries in Main so I can know the filtering works...) Could someone
please be a little more detailed about the how, where and what should be changed? Any code
snippets to be had?
It would be great!
Thanks,
//Karin
-----Ursprungligt meddelande-----
Från: Erin Schnabel [mailto:ebullient.rain@gmail.com]
Skickat: den 6 juli 2007 14:40
Till: xwiki-users(a)objectweb.org
Ämne: Re: SV: [xwiki-users] How to make a new blog
I've done this with our installation for team-level news. Just adjust the "Add
news" form to include a space/web as input (or copy the "Add news" to the
space you want, and fill in the space/web value), and as Vincent said, filter display of
news from within those spaces.. that is, make a "NewSpace.News" or
"NewSpace.Blog" page that lists only those entries belonging to the space, and
you're done.
On 7/6/07, Karin Wiklund <karin.wiklund(a)idainfront.se> wrote:
Ah! :) I just had to log in again to make it work...
http://jira.xwiki.org/jira/browse/XE-73
//Karin
-----Ursprungligt meddelande-----
Från: Vincent Massol [mailto:vincent@massol.net]
Skickat: den 6 juli 2007 13:19
Till: xwiki-users(a)objectweb.org
Ämne: Re: SV: [xwiki-users] How to make a new blog
On Jul 6, 2007, at 1:02 PM, Karin Wiklund wrote:
I'd love to, but I don't have the rights to create issues on
jira.xwiki.org
:)
You do have the rights. You need to create a user that's all :)
Thanks
-Vincent
And thank you for answering. If I figure out something useful I'll let
you know.
//Karin
-----Ursprungligt meddelande-----
Från: Vincent Massol [mailto:vincent@massol.net]
Skickat: den 6 juli 2007 12:05
Till: xwiki-users(a)objectweb.org
Ämne: Re: [xwiki-users] How to make a new blog
BTW, I think that's an interesting feature that we could have out of
the box. If you wish you could create a jira issue for this in the
XWiki Enterprise jira project on
jira.xwiki.org.
Thanks
-Vincent
On Jul 6, 2007, at 12:01 PM, Vincent Massol wrote:
On Jul 6, 2007, at 11:22 AM, Karin Wiklund wrote:
Hi,
This might be a stupid question but I hope someone will be patient
enough to answer it; How do I make a new blog? I don't want another
entry, I want another blog.
My company wants to give each developement project their own blog on
the company xwiki.
I've scanned the mailinglist archíves and the
xwiki.org site for help,
but haven't found anything useful.
I would greatly appreciate your help on this
A blog is made of the following:
- An Article class and associated classsheets/templates
- XWiki documents to which an Article object is added to
- A Main XWiki Document listing blog entries (Blog.WebHome)
Right now the classsheet and Blog.WebHome pages use the Blog.Macros
document to display blog entries. That macro looks for all documents
in the xwiki which have an Article object attached.
If you want several blogs you'll need to add a variable to tell the
Blog.Macros macro to only look in a portion of the wiki. For example
you could decide to pass a Space so that only blog entries in that
space are displayed.
Try editing the Blog.WebHome page and the Blog.Macros macro and you'll
understand.
Warning: you'll need some understanding of XWiki objects/classes/templates.
See the dev guide for more on this.
Thanks
-Vincent
--
You receive this message as a subscriber of the
xwiki-users(a)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
--
You receive this message as a subscriber of the
xwiki-users(a)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
--
'Waste of a good apple' -Samwise Gamgee