[opencms-dev] Absolute links in OpenCmsHtml fields

Mario Jäger m.jaeger at alkacon.com
Thu Aug 5 09:11:52 CEST 2010


Hi Paul,

It is not possible to switch off the link substitution in the OpenCmsHtml field by any configuration.

The link substitution in the OpenCmsHtml field happens in the class org.opencms.xml.types.CmsXmlHtmlValue in the methods 
createStringValue() (called in getStringValue()) and setStringValue() through the usage of the methods processLinks() and 
replaceLinks() of the link processor (class org.opencms.staticexport.CmsLinkProcessor). 

You could try to create a new field which works analogue to the OpenCmsHtml field, but which doesn't substitute the links. 
Thereto, you have to create a new class which extends the class org.opencms.xml.types.CmsXmlHtmlValue and which overwrites 
the methods getStringValue(), createStringValue() and setStringValue(). But, you should create that class in your own module. 
Because, then there is nothing overwritten when you update your OpenCms.

This new field you have to you use in these xsd files of these xml contents, where the link substitution should not happen.

-- 
Kind Regards,
Mario.
 
-------------------
Mario Jäger
 
Alkacon Software GmbH  - The OpenCms Experts                    
http://www.alkacon.com - http://www.opencms.org


Paul-Inge Flakstad schrieb:
> Hi list,
>  
> In an OpenCmsHtml field in a structured content resource type, I need 
> to provide an absolute link to another resource in the VFS.
>  
> Is there any way to disable the automatic link substitution done by 
> OpenCms?
>  
> For example: 
>  
> I enter this link:
>     <a href="http://mysite.com:8080/opencms/opencms/en/page.html">link</a>
> and need to keep it like it is, but OpenCms modifies it into this link:
>     <a href="/en/page.html">link</a>
>  
>  
> Best regards,
> Paul
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list