Is there a way to add the .html extension to the page selected from a granite/ui/components/foundation/form/pathbrowser?
Thank you in advance.
-Dean Anderson
Solved! Go to Solution.
@Dean,
You can achieve it. However, That is something difficult and not
If you want to save, you still have to write so much code (listener on 'ok' button
--Jitendra
Hey Dean,
You can. That would be wrong if you get ".html" extension on every URI provided in the
Here is the piece of code (Groovy) which could help you.
}
The Second option
--
jitendra
I guess the simplest solution is you can take care of this at development side in JSP or Sightly file. Below code shows using JSTL in JSP
Views
Replies
Total Likes
Hi
Apart from what mentioned above, please have a look the stackoverflow answer.
//
The pathfield xtype has a config option called linkpattern. This allows you to configure the widget to automatically add an extension in case the browsefield is used to select the link. If a user types the text , the extension is not added. Use this option to add '.html' and all internal links will have .html appended (assuming the content authors always use the pathfield's browse option to select the link [which they should be doing ] ). This way the backend code doesn't have to be responsible for checking if link is external or internal and appending the extension.
property : "linkPattern" , value : "{0}.html" (String)
Reference : http://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.form.PathField
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Hi kautuk,
Don't you think so we need to take care of selecting an .pdf or .image apart from page.
If user select page, it will work fine, but if pdf is selected, then also it will add .html extension .
Correct me if I am wrong..
Thanks
Views
Replies
Total Likes
Best option (As my previous post) to go would
--
Views
Replies
Total Likes
Hi Praveen
This is a Good catch. But that could also be filtered out using "maskRe" or "regex" Property .
As mentioned by you in one of the recent thread post :- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
Please correct me if i am wrong somewhere. I would really relish improving AEM skills :).
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
This is what I'd like to do, but I'm not sure how to implement such a thing.
My current cq:dialog is pointing to a pathbrowser. I'd like to have some back-end code (utility) that would run when the user selects the path. Either when they return from the pathbrowser dialog it would be populated with .html (if appropriate) or prior to saving to jcr:content. Another option would be when they get the content, have something that triggers a utility to determine whether or not to add .html
Is any of that possible?
Thanks again in advance for your assistance.
-Dean
Views
Replies
Total Likes
@Dean,
You can achieve it. However, That is something difficult and not
If you want to save, you still have to write so much code (listener on 'ok' button
--Jitendra
All,
Thank you so much for your suggestion and help.
I was able to get this resolved by using some javascript.
Thanks Again.
-Dean
Views
Replies
Total Likes
Hi @deana66659071 ,
Can you please elaborate on how you did this solution. If possible can you please provide source code if there is no issue.
Thanks,
Manikanta
Views
Replies
Total Likes
I just used this solution - in case anyone comes across this again:
<div class="card" style="width:280px" style="padding-top:20px;">
<img class="card-img-top" src=${properties.path} alt="Card image cap">
<div class="card-body">
<h5 class="card-title">${properties.heading}</h5>
<p class="card-text">${properties.description}</p>
<a href="${properties.page}.html" class="btn btn-primary">${properties.button}</a>
</div>
</div>
That works fine!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies