Forum Discussion
kiettuongwork
Contributor
I have tried them but could not work. You may need review my previous comments to see
luk
7 years agoBoss
What did not work, you need to provide more information if you want help...this is not your official Lithium support...we cannot see what you are doing, therefore you need to be a bit more detailed in the description of your issues...
if I go to try.freemarker.org
and enter this in the template field:
<#assign url = "https://communitystg.digi.com.my/t5/Blog/bg-p/11112222" /> <#-- first split away any URL parameters, that's the stuff after a question mark "?" what you seem to want is a url-path element, basically what we want is everything before a possible question mark --> <#assign urlparts = url?split("?")?first /> <#-- we then split that first part at every slash "/" --> <#assign urlparts = url?split("?")?first?split("/") /> <#-- and eventually select just the last bit of that sequence to get what you want --> <#assign urlparts = url?split("?")?first?split("/")?last /> <#-- of course you do not need to do that assignment 3 times, once is enough, e.g. like this: --> <#assign urlparts = url?split("?")?first?split("/")?last /> ${urlparts}
it works perfectly, outputting "11112222"...so if that's not what you want, then you have to be more specific.
Related Content
- 7 years ago
- 9 years ago