Creating anchor links in rich text fields with SDL Tridion 2011 SP1

前端 未结 4 500
情话喂你
情话喂你 2020-12-19 09:09

I am trying to use the anchor button in a RTF field of a Component, and getting unexpected behavior. Using the Chrome Browser from the design view, I highlight/select the he

4条回答
  •  一整个雨季
    2020-12-19 10:04

    Thanks Chris, I've edited your solution to fit my requirements so wanted to share for anyone with this issue in the future.

    Note: This moves the text inside the anchor and deletes the text outside. Fixes anchors that were intended to contain text only, not html. i.e My solution fixes this tag:

    Anchor text

    To

    Anchor text

    But not this:

    Anchor text

    Here's my xsl. Hopefully it will help give you a base, I'm sure you could easily update it to look for a following tag (I don't require this for my solution).

    
        
        
            
                
            
        
    
        
        
        
           
                
                    
                                            
                    
                
                
            
        
        
        
    
    

    Here's my test XML

    
    
    
        
        
            

    Anchor linkSome text after

    Anchor - broken with html

    Anchor - broken text only

    Anchor - correctly rendered Some text after

    After transform:

    
        
        
            

    Anchor linkSome text after

    Anchor - broken with html

    Anchor - broken text only

    Anchor - correctly rendered Some text after

    Hope this helps

提交回复
热议问题