问题
I try to map the following html (it´s a small fce)..
<div>
    <div data-hero="1">
        <h1>
            <!-- Headline -->
        </h1>
        <p>
            <!-- Small Text -->
        </p>
        <p>
            <a>
                <span><!-- Button Text --></span>
            </a>
        </p>
    </div>
</div>
Mapping is ok... But when i map the <span> i get a No content found div[1] div[1] p[2] a[1] span[1] error. The <a>-Tag is mapped outter so it should work..
What I try to achieve: Set a Text that is displayed in the <a>-tag, instead of the link target itself.
It´s a TYPO3 4.7 using the latest TemplaVoilà.
Why is that? Thanks in advance!
Edit
@biesior suggested this is not possible - so no i wrap a <span> into the <a>-tag via Typoscript.
Is there a chance to display a certain fields content in this <span> - speak: replacing the linktext, so that i can have a Click here for more ... instead of pageXY?
Btw: I use a linkfield and not the Rich-Text-Editor for setting the link.
回答1:
You can not map any element nested in previously mapped element.
The fastest solution is mapping the A tag, and wrapping inserted text with <span>|</span> with TypoScript.
来源:https://stackoverflow.com/questions/13083989/replacing-a-tag-linktext-with-different-text