DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block |
|---|
@Override
protected Link newPagingNavigationIncrementLink(final String id, final IPageable pageable, final int increment) {
// return your bookmarkable increment (and decrement) link here
}
@Override
protected Link newPagingNavigationLink(final String id, final IPageable pageable, final int pageNumber) {
// return your bookmarkable link here
}
@Override
protected PagingNavigation newNavigation(final IPageable pageable, final IPagingLabelProvider labelProvider) {
return new PagingNavigation("navigation", pageable, labelProvider) {
private static final long serialVersionUID = 1L;
@Override
protected Link newPagingNavigationLink(final String id, final IPageable pageable, final int pageIndex) {
// return your bookmarkable link here
}
};
}
|
A Describing Page Title For Your Pages, Description and Keywords
As you certainly know, the <title> tag of your page is the one that gets shown on the SERPs, so it should be different for all your pages. If your using a BasePage that holds the layout and use markup inheritance for you SubPages a abstract method. The same idea for description and keywords are applicable.
| Code Block |
|---|
<title wicket:id="title"></title>
<META wicket:id="description" NAME="DESCRIPTION" CONTENT=""/>
<META wicket:id="keywords" NAME="KEYWORDS" CONTENT=""/>
|
| Code Block |
|---|
public abstract IModel getPageTitle(); public abstract IModel getDescription(); public abstract IModel getKeywords(); |
is an easy way to force all of your pages to provide a pagetitle, description and keywords. Most commonly the page title depends on your model objects that are going to be displayed on page. E.g. Liverpool FC in the above example. As this object isn't available in the constructor of the superclass, be sure to call getPageTitle() in the onBeforeRenderMethod and also be sure to use addOrReplace instead of only add. e.g.
| Code Block |
|---|
@Override
protected void onBeforeRender() {
// add the <title> tag
addOrReplace(new Label("title", getPageTitle()));
Label desc = new Label("description","");
desc.add( new AttributeAppender("CONTENT", new Model(getPageTitle()), " "));
this.add(desc);
Label keywords = new Label("keywords","");
keywords.add( new AttributeAppender("CONTENT", new Model(getKeywords()), " "));
this.add(keywords);
super.onBeforeRender();
}
|
...