2

I created a sitemapItem as :

  1. jcr configuration: doto/_default_/default/_any_
  2. hst:relativecontentpath: doto/detail/${3}
  3. my url: todo/detail/todo-item4-from-cms-editor-user

How can I get my title "todo-item4-from-cms-editor-user" from query string?

Is ${3} placeholder my title "todo-item4-from-cms-editor-user" within query string?

Thanks

Tlabs
  • 105
  • 8

2 Answers2

3

Please see: http://www.onehippo.org/library/concepts/request-handling/sitemapitem-matching.html

I am going to assume that doto is meant to be todo and is a typo.

todo/default/default/any

will have 3 parameters, $1, $2, $3

todo/detail/todo-item4-from-cms-editor-user

This has only two unknowns. todo will be matched with todo (if doto was meant it won't match at all).

so todo-item4-from-cms-editor-user is actually $2.

Jasper Floor
  • 553
  • 3
  • 6
  • Ok thanks, now http://localhost:8080/site/todo/detail?titleId=todo-item1 work fine for me I'm sorry, I was not clear... but I need to convert http://localhost:8080/site/todo/detail?titleId=todo-item1 as http://localhost:8080/site/todo/detail/todo-item1, http://localhost:8080/site/todo/detail/todo-item2, http://localhost:8080/site/todo/detail/todo-item3 and so on. Is there in HippoCMS a mechanism that describes an url as /todo/detail/{titleId}, where titleId is dinamic? Similar to spring restful url http://www.mkyong.com/spring-mvc/spring-3-rest-hello-world-example/ – Tlabs Nov 24 '14 at 17:05
  • The mailing list already gave an answer but I am including it here for posterity. What you could do is add it to your component just add the hst:parameternames value and give it a name, e.g. "item", then add hst:parametervalues and add ${2} (if you want to get the second segment) Then in your component code you can just use: getComponentParameter("item") And you should get the value of ${2} as a result. see also: http://www.onehippo.org/library/concepts/component-development/hstcomponent-parametersinfo-annotation.html – Jasper Floor Nov 25 '14 at 10:32
  • Or perhaps I completely misunderstood you and what you want is: http://urlrewriter.forge.onehippo.org/index.html as stated by Jeroen Reijn on the mailing list. – Jasper Floor Nov 26 '14 at 09:02
  • Oh well, I really need to an url-rewriting mechanism. Anyway now I have clear also the sitemap argument Ok...Thanks... – Tlabs Nov 26 '14 at 09:21
2

Your todo-item4-from-cms-editor-user is actually ${2}