document type does not allow element "div" here

Nederlandse ondersteuning voor CMS Made Simple

Moderator: velden

Post Reply
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

document type does not allow element "div" here

Post by Gregor »

Hallo,

Ik probeer mijn site te valideren bij w3c en krijg deze melding
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.uisge-beatha.eu%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&No200=1&verbose=1&user-agent=W3C_Validator%2F1.654#line-547
# Error  Line 547, Column 34: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

   



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "" or "") inside an inline element (such as "", "", or "").
Ik zie in de template staan wat de fout veroorzaakt:

Code: Select all

<!-- Start News Display Template -->
{foreach from=$items item=entry}
<div class="NewsSamenvatting">

<table>
   <tr>
       <td>{if $entry->postdate}
	    <div class="NewsSummaryPlaatsingsdatum">
		{$entry->postdate|cms_date_format}
            </div></td>
       <td><div class="NewsSummaryLink">
	        {$entry->titlelink}
              </div>
             {/if}
       </td>
   </tr>
</table>
En als ik wel dit op de site www.uisge-beatha.eu wil bereiken, nl. dat de datum en de link naar het nieuwsartikel achter elkaar staan:
feb 24, 2010    Er is er een jarig
hoera, hoera, dat kun je wel zien dat is zij...

feb 9, 2010   Iets nautisch doen

Laten we zondag iets nautisch gaan doen...
Hoe zou ik dat dan in de template voor elkaar kunnen krijgen?

Gregor
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: document type does not allow element "div" here

Post by Gregor »

Na enig zoeken, de volgende aanpassing gedaan:

Code: Select all

<div style="position: relative; width: 80%; height: 20px;">
	{if $entry->postdate}
         		<div style="position: absolute; left: 0px; top: 0px; width: 75px; height: 20px;">{$entry->postdate|cms_date_format}</div>
		<div style="position: absolute; left: 90px; top: 0px; width: 95%; height: 20px;">{$entry->titlelink}</div>
	{/if}
</div>
Wat er nu niet gebeurt is het gebruik van de classes voor het opmaken van Plaatsingsdatum en Summarylink. Daarom de volgende aanpassing gedaan:

Code: Select all

<div style="position: relative; width: 80%; height: 20px;">
	{if $entry->postdate}
		<div style="position: absolute; left: 0px; top: 0px; width: 75px; height: 20px;">			<div class="NewsSummaryPlaatsingsdatum">
				{$entry->postdate|cms_date_format}
			</div>
		</div>

         		{$entry->postdate|cms_date_format}</div>
		<div style="position: absolute; left: 90px; top: 0px; width: 95%; height: 20px;">
			<div class="NewsSummaryLink">
				{$entry->titlelink}
			</div>
		</div>
	{/if}
</div>
Maar dat leidt tot een geheel verschoven pagina. Overigens blijft de w3c-foutmelding bestaan omdat er in een probleem blijft bestaan. Iemand een suggestie?

Gregor
Last edited by Gregor on Wed Feb 24, 2010 8:40 am, edited 1 time in total.
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Re: document type does not allow element "div" here

Post by brentnl »

Een suggestie heb ik niet, maar hetzelfde probleem wel...  ;D K*t W3C... ook al klik je op Clean up Markup with HTML Tidy, dan nog repareert hij de fout niet... En in mijn div's staan alleen elementen als en . Verder staan er in mijn inline elementen geen block elementen.. dus dat kan het ook niet zijn..
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: document type does not allow element "div" here

Post by Rolf »

Waarschijnlijk staat er in de pagina:

Code: Select all

<p>{news}</p>

Code: Select all

<div>{news}</div>
Should do the trick..

®
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: document type does not allow element "div" here

Post by Gregor »

Nog een hoop te leren  ;)
Op de hoofdpagina het aantal 'fouten' teruggebracht tot 1. Ga me eens buigen over de rest van de pagina's.

Thnkx Rolf

Gregor
Post Reply

Return to “Dutch - Nederlands”