掲示板
How to pass dynamic value to web content template
7年前 に Naresh Reddy Kallamadi によって更新されました。
How to pass dynamic value to web content template
Regular Member 投稿: 120 参加年月日: 14/07/09 最新の投稿
Hi All,
I have below code to get the content as dynamic using journalArticle service in theme :
#set ($journalArticleDisplay = $journalArticleLocalService.getArticleDisplay($themeDisplay.getScopeGroupId(),$journalArticle.getArticleId(), $someTemplate.getTemplateId(), "view", $themeDisplay.getLanguageId(), $themeDisplay))
$journalArticleDisplay.getContent()
But here I need to pass one dynamic value to template based on that data will pick the data for example language
Can some one have a look?
I have below code to get the content as dynamic using journalArticle service in theme :
#set ($journalArticleDisplay = $journalArticleLocalService.getArticleDisplay($themeDisplay.getScopeGroupId(),$journalArticle.getArticleId(), $someTemplate.getTemplateId(), "view", $themeDisplay.getLanguageId(), $themeDisplay))
$journalArticleDisplay.getContent()
But here I need to pass one dynamic value to template based on that data will pick the data for example language
Can some one have a look?
7年前 に Olaf Kock によって更新されました。
RE: How to pass dynamic value to web content template
Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿Naresh Reddy Kallamadi:
But here I need to pass one dynamic value to template based on that data will pick the data for example language
Typically you'd not "pass" some parameter to the theme, the theme would rather look it up (or I'm not understanding what you're asking for). Where do you have the values that you need in your theme? What are they? Also, it might be easier to embed a standard portlet in the theme and do the processing there...
7年前 に Naresh Reddy Kallamadi によって更新されました。
RE: How to pass dynamic value to web content template
Regular Member 投稿: 120 参加年月日: 14/07/09 最新の投稿
Thanks Olaf Kock,
Actually I am trying to get the data from article by using below snippet in theme
#set ($journalArticleDisplay = $journalArticleLocalService.getArticleDisplay($themeDisplay.getScopeGroupId(),$journalArticle.getArticleId(), $someTemplate.getTemplateId(), "view", $themeDisplay.getLanguageId(), $themeDisplay))
$journalArticleDisplay.getContent()
$someTemplate.getTemplateId() ==> template id which is created in control panel.
While getting the data from article using template I need to pass some variable to template like country code
Template code:
#set(parameterValueFromTheme = Here I supposed to get the parameter which was set in theme)
If(parameterValueFromTheme == 'au') {
somecode
}else{
some code here
}
Actually I am trying to get the data from article by using below snippet in theme
#set ($journalArticleDisplay = $journalArticleLocalService.getArticleDisplay($themeDisplay.getScopeGroupId(),$journalArticle.getArticleId(), $someTemplate.getTemplateId(), "view", $themeDisplay.getLanguageId(), $themeDisplay))
$journalArticleDisplay.getContent()
$someTemplate.getTemplateId() ==> template id which is created in control panel.
While getting the data from article using template I need to pass some variable to template like country code
Template code:
#set(parameterValueFromTheme = Here I supposed to get the parameter which was set in theme)
If(parameterValueFromTheme == 'au') {
somecode
}else{
some code here
}