Reputation: 5122
The context:
I need to insert an imagemap into a page in TYPO3 6.1.
As EXT:imagemap_wizard is not working currently in 6.1, I can create the imagemap offline and then insert it via the HTML content type.
The question:
It would be nice to be able to just write the internal URLs in the HTML, but output realURLs. Can the "HTML" type field be passed through the parser that renders URLs?
So that
<area shape="rect" href="index.php?id=55" coords="6,153,189,231" alt="">
would be rendered as
<area shape="rect" href="/my/realurl/" coords="6,153,189,231" alt="">
Or is there another way? Maybe put the HTML into a fluid template and tell it to render any URL it finds in the template?
Upvotes: 3
Views: 811
Reputation: 3631
The simple approach with parseFunc_RTE does not work, because we need to act on the attribut. So, this code is tested with css_styled_content TYPO3 6.1. So, just use the tags function:
# we parse the HTML, but we only focus on tag *area*
# i created an COA, because IMHO it is easier to maintain.
# i guess, it would be possible in a few lines only, but i did not tested that
tt_content.html.parseFunc.tags.area = COA
tt_content.html.parseFunc.tags.area {
wrap = <area |/>
20 = TEXT
# all attributs are loaded into parameters array
20.data = parameters:shape
20.noTrimWrap = | shape="|" |
30 = TEXT
30.typolink.parameter.data = parameters:href
# we only need the URL, not the full link
30.typolink.returnLast = url
30.noTrimWrap = | href="|" |
40 = TEXT
40.data = parameters:coords
40.noTrimWrap = | coords="|" |
50 = TEXT
50.data = parameters:alt
50.noTrimWrap = | alt="|" |
}
# for testcase, create TS-Template with css_styled_content included
# and create html-record on that page in column 0
page = PAGE
page.10 < styles.content.get
Upvotes: 1
Reputation: 3631
If you parse the HTML-Content object via lib.parseFunc, you can use the -Tag which will create typolinks. With realurl installed, you get the urls you want:)
The HTML-Content Object will be rendered (with css_styled_content) via tt_content.html.
So add
tt_content.html.parseFunc < lib.parseFunc_RTE
To your HTML Object, and put in your content the LINK-Tag:
<area shape="rect" href="<link>55</link>" coords="6,153,189,231" alt="">
IMHO not an accademic question, you should allways use typolinks :)
Upvotes: 2