Skip to main content
5 of 5
edited tags
Rick Pannekoek
  • 21.4k
  • 1
  • 18
  • 30

Anchor in component link not showing on Java application (dxa 2.0.3) with dxa model service 2.2.2

We're trying to implement Anchor Link on our existing Link Component by Enabling Anchor Feature in cd_link_conf.xml

This is our configuration looks like

<Publications OverrideDiscoveryService="true">
    <Publication Id="33">
        <Host Domain="mysite.test" Port="80" Path="" Protocol="https" />
        <Linking ComponentAnchors="true" AddComponentLinkInfo="true" />
    </Publication>
</Publications>

Link schema enter image description here

and our link model class

@Data
@EqualsAndHashCode(callSuper = true)
public class Link extends AbstractEntityModel {

    @JsonProperty("linkTekst")
    private String linkTekst;

    // url property; neem externeLink als interneLink niet bestaat.
    @SemanticProperties({
            @SemanticProperty("interneLink"),
            @SemanticProperty("externeLink")
    })
    @JsonProperty("url")
    private String url;

    @SemanticProperty("interneLink")
    private EntityModel embeddedLink;

    @JsonProperty("alternatieveTekst")
    private String alternatieveTekst;
    @JsonProperty("linkStyle")
    private Tag linkStyle;
}

We came with 2 problems:

  • Anchor hash is not added in the url
  • url always use domain defined by cd_link_conf.xml. It's not dynamic following where the web application runs (e.g. on localhost, urls points to mysite.test domain instead of localhost)

Is there anything that I miss?

Specs:

  • Java application uses dxa 2.0.3 framework.
  • Dxa Model service 2.2.2
Chris
  • 137
  • 5