|
This article or section is a stub. Stubs are articles that have not yet received substantial attention from the authors. They are short or insufficient pieces of information and require additions to further increase the article's usefulness. The project values stubs as useful first steps toward complete articles.
|
|
I've needed to set up blog-like functionality on a few wikis now, so I want to get the common features into one place so it's easier to implement in future.
Blog roll
Adding this code to the ArticleSave hook makes sure that signatures are consistent and CSS addressable in any new sections that are added to talk pages. And also wraps the whole comment that was just added into a CSS addressable div element.
Adding this code to the ArticleUpdateBeforeRedirect hook allows a returnto parameter to be added to the link for adding a comment (which is actually a new-section-edit link to a talk page) so that it returns back to the news page or the news item being commented on.
CSS rules
The following CSS rules placed into MediaWiki:Common.css make the news items look nicer:
|
|
<css>
table.news {
background-color: #f6f6f6;
border: 1px solid #aaa;
padding: 5px 30px 15px 30px;
width: 700px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
-khtml-border-radius: 9px;
border-radius: 9px;
}
table.news .editsection {
display:none;
}
- bodyContent table.news h2 {
margin-bottom: 0;
}
table.news th, #bodyContent .news-addcomment a.external {
text-align: left;
font-weight: normal;
font-size: 75%;
color: #666;
}
table.news th a {
text-decoration: underline;
color: #666;
}
.news-comment {
margin-top: 5px;
padding: 5px 10px;
background: #d6d6d6;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
-khtml-border-radius: 9px;
border-radius: 9px;
}
.news-comment h2 {
border: none;
font-size: 125%;
color: #666;
}
.comment-sig {
font-size: 70%;
color: #333;
}
</css>
|
|
Here's a screenshot of the news page with the applied CSS and hooks:
Adding new items
See also