Skip to content

Instantly share code, notes, and snippets.

@UberNick
Created September 20, 2013 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UberNick/6639158 to your computer and use it in GitHub Desktop.
Save UberNick/6639158 to your computer and use it in GitHub Desktop.
String defaultPostName = "";
//Below is logic to default posts based on page selectors.
//e.g. posts.{post-name.}.html
String selectorPath = currentPage.adaptTo(Resource.class).getResourceMetadata().getResolutionPathInfo();
String selectors[] = selectorPath.split("\\.");
if (selectors.length > 2) {
defaultPostName = selectors[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment