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>
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 EmbeddableLinkEntityModel 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