Jahia Dev Forum > Mysterious div with...

0 (0 Good)
0 (0 Bad)

Mysterious div with class equals clear

by  rusashi »  2013/01/23 05:43

Hello guys. Recently I was trying to add some modules to jahia to ease css design with edit mode. I really don't like frameworks like 960gs so I needed some modules to give me basic html div tags.

I created a module simpleDiv with the following definition:

 

<jnt = 'http://www.jahia.org/jahia/nt/1.0'>
<jmix = 'http://www.jahia.org/jahia/mix/1.0'>
 
[jnt:simplediv] > jnt:content, jmix:structuredContent, jmix:editorialContent
- classNames (string) indexed=no
- classId (string) indexed=no
 
And the following view:
 
<%@ taglib prefix="jcr" uri="http://www.jahia.org/tags/jcr" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="utility" uri="http://www.jahia.org/tags/utilityLib" %>
<%@ taglib prefix="template" uri="http://www.jahia.org/tags/templateLib" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="query" uri="http://www.jahia.org/tags/queryLib" %>
 
<div <c:if test="${not empty currentNode.properties.classNames}">class="${currentNode.properties.classNames.string}"</c:if> <c:if test="${not empty currentNode.properties.classId}"> id="${currentNode.properties.classId.string}" </c:if> >
<template:area path="content_${currentNode.name}"/>
</div>
 
As you can see this module is just a simple div tag with id and class attributes. It works good, I am able to define a new web page and put my simple div inside and work with. But one strange thing happens. If for example I will add a simple text module inside this div a strange div will appear right after the text. This div looks like this:
 
<div class="clear"></div>
 
The same div appears right after last div on the page. I looked at the page source when there no modules at all and this div is absent. But when I start to add modules this div start to appear.
 
Do you know who is responsible for this strange div and how to turn it off? Thank you.
 

 

  • Mysterious div with class equals clear
    2013/01/23 05:43

    rusashi <p> Hello guys. Recently I was trying to add some modules to jahia to ease css design with edit mode. I really don&#39;t like frameworks like 960gs so I needed some modules to give me basic html div tags.</p> <p> I created a module simpleDiv with the following definition:</p> <p> &nbsp;</p> <div> &lt;jnt = &#39;http://www.jahia.org/jahia/nt/1.0&#39;&gt;</div> <div> &lt;jmix = &#39;http://www.jahia.org/jahia/mix/1.0&#39;&gt;</div> <div> &nbsp;</div> <div> [jnt:simplediv] &gt; jnt:content, jmix:structuredContent, jmix:editorialContent</div> <div> - classNames (string) indexed=no</div> <div> - classId (string) indexed=no</div> <div> &nbsp;</div> <div> And the following view:</div> <div> &nbsp;</div> <div> <div> &lt;%@ taglib prefix=&quot;jcr&quot; uri=&quot;http://www.jahia.org/tags/jcr&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;fmt&quot; uri=&quot;http://java.sun.com/jsp/jstl/fmt&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;utility&quot; uri=&quot;http://www.jahia.org/tags/utilityLib&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;template&quot; uri=&quot;http://www.jahia.org/tags/templateLib&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;fn&quot; uri=&quot;http://java.sun.com/jsp/jstl/functions&quot; %&gt;</div> <div> &lt;%@ taglib prefix=&quot;query&quot; uri=&quot;http://www.jahia.org/tags/queryLib&quot; %&gt;</div> <div> &nbsp;</div> <div> &lt;div &lt;c:if test=&quot;${not empty currentNode.properties.classNames}&quot;&gt;class=&quot;${currentNode.properties.classNames.string}&quot;&lt;/c:if&gt; &lt;c:if test=&quot;${not empty currentNode.properties.classId}&quot;&gt; id=&quot;${currentNode.properties.classId.string}&quot; &lt;/c:if&gt; &gt;</div> <div> &lt;template:area path=&quot;content_${currentNode.name}&quot;/&gt;</div> <div> &lt;/div&gt;</div> <div> &nbsp;</div> <div> As you can see this module is just a simple div tag with id and class attributes. It works good, I am able to define a new web page and put my simple div inside and work with. But one strange thing happens. If for example I will add a simple text module inside this div a strange div will appear right after the text. This div looks like this:</div> <div> &nbsp;</div> <div> &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</div> <div> &nbsp;</div> <div> The same div appears right after last div on the page. I looked at the page source when there no modules at all and this div is absent. But when I start to add modules this div start to appear.</div> <div> &nbsp;</div> <div> Do you know who is responsible for this strange div and how to turn it off? Thank you.</div> <div> &nbsp;</div> </div> <p> &nbsp;</p>

  • Number of messages  8
    Registration date Jan 23, 2013
    0 (0 Good)
    0 (0 Bad)

    Re: Mysterious div with class equals clear

    by  rmora »  2013/01/25 10:15

    Hello,

    This method is explained here:
     
    You could change it and use a different one:
     
    Create a new your own view of jmix:list based on list.jsp and remove 
    <c:if test="${not omitFormatting}"> <div class="clear"> </ div> </ c: if>
     
    Other methods are explained in here:
     
    It will be changed in future versions
    Best regards
  • Re: Mysterious div with class equals clear
    2013/01/25 10:17

    rmora <p> Hello,</p> <div> This method is explained here:</div> <div> &nbsp;</div> <div> <a href="http://css-tricks.com/the-how-and-why-of-clearing-floats/">http://css-tricks.com/the-how-and-why-of-clearing-floats/</a></div> <div> You could change it and use a different one:</div> <div> &nbsp;</div> <div> Create a new your own view of jmix:list based on list.jsp and remove&nbsp;</div> <div> &lt;c:if test=&quot;${not omitFormatting}&quot;&gt; &lt;div class=&quot;clear&quot;&gt; &lt;/ div&gt; &lt;/ c: if&gt;</div> <div> &nbsp;</div> <div> Other methods are explained in here:</div> <div> <a href="http://www.positioniseverything.net/easyclearing.html">http://www.positioniseverything.net/easyclearing.html</a></div> <div> &nbsp;</div> <div> It will be changed in future versions</div> <div> Best regards</div>

  • Number of messages  10
    Registration date Jan 25, 2013
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Mysterious div with class equals clear

    by  rusashi »  2013/01/25 12:50

    Thank you so much!!

    You really hepled me. Can I ask for one more question pls. I found that jmix_list and understand that I need just to remove that line with div tag. But I don't understand where I need to set Jahia to use modified jmix. I mean during the work in edit mode I just dropped my custom div and put simple text module inside of it, I never used this jmix:list module and don't know how and when it kicks in and how to switch it to a modified version. Can you help me?

  • Re: Re: Mysterious div with class equals clear
    2013/01/25 13:09

    rusashi <p> Thank you so much!!</p> <p> You really hepled me. Can I ask for one more question pls. I found that jmix_list and understand that I need just to remove that line with div tag. But I don&#39;t understand where I need to set Jahia to use modified jmix. I mean during the work in edit mode I just dropped my custom div and put simple text module inside of it, I never used this jmix:list module and don&#39;t know how and when it kicks in and how to switch it to a modified version. Can you help me?</p>

  • Number of messages  8
    Registration date Jan 25, 2013
    0 (0 Good)
    0 (0 Bad)

    Re: Re: Re: Mysterious div with class equals clear

    by  rmora »  2013/01/25 13:57

    Hello, just put the same named file in your template set and this file will be used (yourTemplate/jmix_list/list.jsp)
    It's the jahia's concept! this jsp maybe need other things (if it's to difficult for you, overwrite the one in jahia default)

    Best regards,
    régis
     

  • Re: Re: Re: Mysterious div with class equals clear
    2013/01/25 14:22

    rmora <p> Hello, just put the same named file in your template set and this file will be used (yourTemplate/jmix_list<font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size: 14px; line-height: 20px;">/</span></font>list.jsp)<br /> It&#39;s the jahia&#39;s concept! this jsp maybe need other things (if it&#39;s to difficult for you, overwrite the one in jahia default)</p> <p> Best regards,<br /> r&eacute;gis<br /> &nbsp;</p>

  • Number of messages  10
    Registration date Jan 25, 2013
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page