Data Attributes on Div Tag's in Raw HTML Standard Page


(Lauren) #1

Matrix Version: v5.3.3.0

Hello,

I am trying to add data attributes on my div tags but when the page is viewed a ="" has been appended to the end of the attribute name.

For example I have placed into a Raw HTML content area in a standard page the below code:

<header id="header" class="header">
</header>
<div data-sticky-container>
  <div data-sticky data-margin-top='0' data-top-anchor="header:bottom" data-btm-anchor="content:bottom">
    <div class="top-bar"> 
      <div class="top-bar-title">
        <img src="http://placehold.it/150x38" alt="" />
      </div> 
      <div class="top-bar-right">
        <ul class="menu">
          <li><a href="#">Thing 1</a></li>
          <li><a href="#">Thing 2</a></li>
          <li><a href="#">Thing 3</a></li>
        </ul>
      </div>
    </div>
  </div>
</div>

When it is viewed live in a browser it looks like so:

<header id="header" class="header">
</header>
<div data-sticky-container="">
  <div data-sticky="" data-margin-top='0' data-top-anchor="header:bottom" data-btm-anchor="content:bottom">
    <div class="top-bar"> 
      <div class="top-bar-title">
        <img src="http://placehold.it/150x38" alt="" />
      </div> 
      <div class="top-bar-right">
        <ul class="menu">
          <li><a href="#">Thing 1</a></li>
          <li><a href="#">Thing 2</a></li>
          <li><a href="#">Thing 3</a></li>
        </ul>
      </div>
    </div>
  </div>
</div>

How can I stop Matrix from appending data attribute’s with =""

Thanks


(Peter McLeod) #2

Hi

Don’t think it’s matrix doing it, especially if it in a raw HTML container, more likely the browser is doing it. If you view the source in your browser you’ll see what is served to your browser from matrix.

If you are just adding the attribute name with no value it’s kind the same thing anyway. What issues it it causing?

Thanks
Peter