2

Upgrading from DD4T to DXA. our website by default will have extensions ex(http://www.mysite.com/index.html) but By default DXA resolves Component Links in Rich Text field and Component Link fields without Page extension(.html) but in my application we need the extension. Please help me get the Page url with extension.

  • Can you explain why you need the file extension? – Rick Pannekoek Jul 9 '18 at 14:25
  • Our existing website urls ends with extensions, so we need it in the same way while upgrading to DXA2.0. Example I need mysite/index.html in richtext field instead of mysite/index – Balajhi SV Jul 9 '18 at 22:26
  • So you want to use a hybrid web site/app, where parts are served by DXA and other parts are still "legacy"? Can you elaborate? Please update the question rather than in comments. – Rick Pannekoek Jul 10 '18 at 7:51
4

In DXA 2.0, using the new R2 Data Model and Model Service, link resolving is done in the Model Service.

The Model Service uses the following class for this purpose: https://github.com/sdl/dxa-web-application-java/blob/master/dxa-framework/dxa-common/src/main/java/com/sdl/webapp/tridion/linking/AbstractLinkResolver.java

Note that removal of file extension is configurable through setting dxa.web.link-resolver.remove-extension

  • Sorry Rick i forgot to mention am using .NET.. If can provide details for .NET that will be more helpful. – Balajhi SV Jul 10 '18 at 7:15
  • 1
    The Model Service is a separate subsystem which is implemented in Java only. However, it seems you only have to modify its configuration settings, so you don't need much Java knowledge. – Rick Pannekoek Jul 10 '18 at 7:46
1

Note: For poor people like me. Setting can be found in "{model-service-path}/config/dxa.properties"

dxa.web.link-resolver.remove-extension=false

  • Good to hear that you managed to figure that out! For clarity: it's not that I knew this, but didn't want to disclose it to "poor people". I just found how it worked in code, but didn't know how that translated exactly to configuration files. – Rick Pannekoek Jul 10 '18 at 15:35
  • Rick i didn't mean it in wrong way.. i noticed some code in the Framework solution(Sdl.Web.Tridion.Linking and Sdl.Web.Common.Constants) where the extensions are being removed. i didnt expect tat in service so i mention the path. May be we need to update tat also. – Balajhi SV Jul 11 '18 at 13:10
  • It’s OK. Can you still elaborate on why you need the file extension (see my comment on your Question)? This may help others that have a similar situation and it also help us/me to understand how people are using our system. – Rick Pannekoek Jul 11 '18 at 19:51
  • I have updated in the question.. our existing site has extensions so we are moving with the same approach. – Balajhi SV Jul 13 '18 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.