sling:target to /geohome on the /content node | Community
Skip to main content
LinearGradient
Level 6
October 16, 2015
Solved

sling:target to /geohome on the /content node

  • October 16, 2015
  • 3 replies
  • 1561 views

Hi,

I just noticed that the /content node has the following two properties:

    sling:target = /geohome
    sling:resourceType = sling:redirect

Is it advisable to change these values for an in-production installation?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Yes please.

You need to update the property "sling:target" on the "/content" node OR configure RootMappingServlet. Configuring at /content you can activate through package.

You have two options:-

Option1:- At repository for publish run mode configure RootMappingServlet [1]. Steps would be

* Create /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet
* Define property rootmapping.target with value equal to home page path.
* Activate /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet

[1] http://<host>:<port>/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet

Option 2:-
* Modify sling:target on the "/content" node of author.
* Create a package to include only content using exclude filters (attaching snapshot). Once the package is built. Activate the package & will get pushed to publish instance and get installed automatically. More samples of package filter at http://aemfaq.blogspot.com/2013/04/cq5-package-filter-includeexclude.html

3 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

Yes please.

You need to update the property "sling:target" on the "/content" node OR configure RootMappingServlet. Configuring at /content you can activate through package.

You have two options:-

Option1:- At repository for publish run mode configure RootMappingServlet [1]. Steps would be

* Create /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet
* Define property rootmapping.target with value equal to home page path.
* Activate /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet

[1] http://<host>:<port>/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet

Option 2:-
* Modify sling:target on the "/content" node of author.
* Create a package to include only content using exclude filters (attaching snapshot). Once the package is built. Activate the package & will get pushed to publish instance and get installed automatically. More samples of package filter at http://aemfaq.blogspot.com/2013/04/cq5-package-filter-includeexclude.html

LinearGradient
Level 6
October 16, 2015

Hi Sham,

Thanks for the reply. Could you please explain the purpose of the "sling:target" on the content node? I mean, if I open localhost:4502/content, it redirects to the given target, but what's the use case for this?

Sham_HC
Level 10
October 16, 2015

LinearGradient wrote...

Hi Sham,

Thanks for the reply. Could you please explain the purpose of the "sling:target" on the content node? I mean, if I open localhost:4502/content, it redirects to the given target, but what's the use case for this?

 

The destination of request for route ("/" alias landing page)  is decided by root mapping servlet (http://localhost:4502/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet) based on run mode. OOB in author instance  it is /welcome & publish instance it is /content.   The /content does not have any resource to render & it redirect to vanity url so that page can be rendered.      We unnecessarily  introduced RootMappingServlet which could be well handled with vanity path with highest ranking might be in future release we will get rid of RootMappingServlet.   Make sense?