Pregunta

I am struggling to get a Typo3 website working using Fluid templates instead of TV. I used modernpackage to create an extension for my template. However, when the site is rendered (without changing anything to the template) the css and js are loaded twice but one of them returns a 404.

When I look in the code I see that the head tag is renderend correctly, but the body tag is rendered like this:

<body class="page-1 template-">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TYPO3 Sitestarter Start</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/mediaqueries.css" rel="stylesheet">
<link href="css/flexslider.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="css/responsiveTable.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="css/yoxview.css" rel="stylesheet">

<link rel="shortcut icon" href="img/favicon.png">

<script src="js/modernizer-2.6.2.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://sitename/typo3/sysext/t3skin/stylesheets/standalone/admin_panel.css" />    </head>
<body>
...

It looks like the whole template is rendered in the body. Why is this happening and how can I prevent this from happening?

¿Fue útil?

Solución

It is usual for a fluid template to get rendered completely when not using a layout and sections. In your adaption of modernpackage, make sure that on top of your main template the line

<f:layout name="Default" />

is included which will use the file "Default.html" in the Layouts subfolder of the extensions Template folder as a layout. The file will contain only one line:

<f:render section="body" />

By doing this the only thing in your main template that will get rendered is anything in between these tags:

<f:section name="body">...</f:section>

Anything before or after will now be ignored and the double rendering will be prevented.

Otros consejos

Try the TSOB and Template analyzer to get to the bottom of this. By searching for one of the erronous links' filenames in the TSOB you should find out where this is rendered and be able to remove it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top