この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
I have a component of resource type - granite/ui/components/foundation/form/pathbrowser , i need to make sure in case of internal link .html to be appended whereas in case of external link it should be as it is no .html appending. Can anyone help?
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
In case of Touch UI, we need to make use of Java Code only, I was not able to find any other options.
This is the code which I tried and it worked for me.
Here I am checking for the 4 cases:
1. Checking for file extension:- so if the file extension is .mp4 or .mp3 like that then we are not processing the URL and simply returning it.to check the different extension we have created an enum class. like this.
case 2: if URL is null or empty then we are sending null.
case 3: if URL starts with "/content" then we are appending ".html"
case 4: if URL starts with "http" or "https" or "www" then we are simply sending back the URL without performing any operation as it is an external link.
表示
返信
いいね!の合計
Once you get user input and before displaying it as a link, check if this is internal page or not. You can PageManger & Resource API for this.
ashish kumarm48760261 wrote...
I have a component of resource type - granite/ui/components/foundation/form/
pathbrowser , i need to make sure in case of internal link .html to be appended whereas in case of external link it should be as it isno . html appending. Can anyone help?
表示
返信
いいね!の合計
Jitendra S.Tomar wrote...
Once you get user input and before displaying it as a link, check if this is internal page or not. You can PageManger & Resource API for this.
![]()
ashish kumarm48760261 wrote...
I have a component of resource type - granite/ui/components/foundation/form/pathbrowser , i need to make sure in case of internal link .html to be appended whereas in case of external link it should be as it is no .html appending. Can anyone help?
The whole point is to avoid doing backend code checks. The "linkpattern" config options for pathfield would enable us to handle it all by itself. Check the API here is the API snippet.
linkPattern : String
Defaults to '{0}.html' if parBrowse = true, otherwise simply '{0}'.
Writing an explict condition in the backend code to add .html is not required.
表示
返信
いいね!の合計
Yeah but here i am working in Touch UI (granite/ui/components/foundation/form/pathbrowser ) for AEM 6.2 , so this property seems to be invalid for this case.
表示
返信
いいね!の合計
Do we have an answer for this? How to configure this in touch UI pathbrowser?
表示
返信
いいね!の合計
Hi,
Did you get an answer to it how it could be accomplished in touchui?
表示
返信
いいね!の合計
In case of Touch UI, we need to make use of Java Code only, I was not able to find any other options.
This is the code which I tried and it worked for me.
Here I am checking for the 4 cases:
1. Checking for file extension:- so if the file extension is .mp4 or .mp3 like that then we are not processing the URL and simply returning it.to check the different extension we have created an enum class. like this.
case 2: if URL is null or empty then we are sending null.
case 3: if URL starts with "/content" then we are appending ".html"
case 4: if URL starts with "http" or "https" or "www" then we are simply sending back the URL without performing any operation as it is an external link.
表示
返信
いいね!の合計