PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) General questions / FAQ fix_base_path: multiple patterns

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26477

    Hello,

    I am attempting to use the “fix_base_path” tag in order to add a domain name to selected html links. My current code is such:

    <pd4ml:fix_base_path<br /> pattern="/css/"<br /> basePath="http://mydomain.com"<br /> addSessionID="false"<br /> >

    This only replaces links that start with “/css/”. However, I would also like to replace links that start with other directories, such as “/img/” or “/js/”. Is there a way to add multiple patterns to this directive, or to provide the pattern in such a way that it can match other directories?

    Thank you for your assistance!

    Best Regards,
    – Clayton

    #28292

    Try do define multiple nested tags with needed patterns.

    [language=xml:3bxr5yn6] Content to apply the tags to

    [/language:3bxr5yn6]

    On the other hand recent versions of PD4ML are able to resolve absolute web paths via ServletContext. I would recommend to add debug=”true” to and ispect STDOUT what it tries to load and whether the URLs are correct.

    #28293

    Thanks, that worked perfectly!

    I was trying the “debug” option, but the referenced paths were still relative. Plus, I wanted to strip out the jsessionId from the resulting URL …

    However, nesting the tags did the trick. Thank you for the quick reply!

    Best,
    – Clayton

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.