jeeva
jeeva

Reputation: 1603

how to remove span tag from smarty value in htm file?

I have htm file called user.htm. Here i will display my user details.When i'm trying to add link to user image i have one problem. span tag is exist in the image link.

For ex, $img_link= '/image/users/44.jpg'.I want to remove the span tag from $img_link in user.htm.

my code is:

<img src="http://www.mysite.com/Imprenta/{$ruta_value}" height="50px" width="150px" />

Here the value of {$ruta_value} is => '/user/images/44.jpg'

I can not use PHP functions like str_replace or strip_tags here. how to do it?

Upvotes: 0

Views: 476

Answers (2)

m4ngl3r
m4ngl3r

Reputation: 560

if you want to remove span tag from HTML give it an ID <span id="userSpan"> </span> then use little JavaScript here

var span = document.getElementById("userSpan");
span.parentNode.removeChild(span);

Upvotes: 0

Sibu
Sibu

Reputation: 4617

You can very much use strip_tags in smarty like this ,

{$img_link|strip_tags}

So in your case, it will be like

<img src="http://www.mysite.com/Imprenta/{$ruta_value|strip_tags}" height="50px" width="150px" />

Upvotes: 3

Related Questions