Removing the last characters in an XSLT string

后端 未结 6 1007
谎友^
谎友^ 2020-12-03 15:40

In my CMS it is possible to create a new article, and choose an image to be shown on that article. When an image is chosen, a thumbnail of the image will automatically be cr

6条回答
  •  独厮守ぢ
    2020-12-03 16:15

    Given the image's filename in $filename,

    If you can assume that all images will end in ".jpg" and won't have ".jpg" elsewhere in the filename, then this should work:

    
    

    If you don't know the image type (like, you want to handle gif and png as well), or if you think the extension may occur multiple times in the filename ("image.jpg.jpg"), then you will want a template to help you:

    
    
        
    
        
            

提交回复
热议问题