Jump to content

<i Tag Question used in Smarty


Recommended Posts

Keep  in mind I am not a web designer or PHP or Smarty developer. 

So, I have this smarty.tpl script that I am trying to figure out how the code flows.  It uses smarty for creating templates.

Within the file is an <i html tag.  Researching it at https://www.w3schools.com/tags/tag_i.asp tells me it is used for styling text.

However, I have the following:   <i class="fa fa-video fa-fw js_x-uploader" data-handle="publisher" data-type="video"></i> {__("Add Video")}

My question is:  It appears that the js_x-uploader affects what happens when I click on a link. The button is the "Add Video" button in a drop down menu.  When I click the "Add Video"

button a windows explorer pops and I pick a mp4 video to post to a page timeline.  When I change the js_x-uploader to something else, arbitrarily,  the win explorer does not pop.  I am confused as to 

why  js_x-uploader acts like this.   There is nothing in w3school that explains this action for the <i tag?

I hope I articulated my question enough?





Link to comment
Share on other sites

It has nothing to do with the <i> tag itself. The Javascript library just looks for any elements with certain class names and replaces them with videos, links and other things. Any other element could have been used, but <i> was probably chosen because it's very short and has no semantic meaning.

Everything you know about HTML, Javascript can break it. If you want to understand all of this better you will have to learn Javascript in depth.

Link to comment
Share on other sites

Javascript searches for all elements on the page that have a certain value in their class attribute. Then it puts another element next to it. To open a file dialog, you just need a file type input, like this:

<input type="file">

The Javascript library is putting one of those in the place of the original <i> element.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...