From kraftb at kraftb.at Fri Mar 1 21:07:25 2013 From: kraftb at kraftb.at (Bernhard Kraft) Date: Fri, 01 Mar 2013 21:07:25 +0100 Subject: [TYPO3-extbase] FLUIDTEMPLATE In-Reply-To: References: Message-ID: Hello ! Am 27.02.2013 15:22, schrieb Stefan Reichelt: > Besides the adding of viewhelpers ( anyway. You don't really need layouts or partials at all, although both > can help and are useful of course. I know about those ... What I did until now is: template.html: ------------------------ ... Complete Site Layout and Content here ... ------------------------ And then default.html: ------------------------ ------------------------ This achieves my requirements. But I wonder if this is how it should be. The problem with your approach is that the tag is rendered either twice (once from TYPO3, the other time from the template) or that I have to use a "template.html" without head tag. This way it is unusable when not called via TYPO3 (So you can't handle it back to the designer). greetings, Bernhard From kraftb at kraftb.at Fri Mar 1 21:09:31 2013 From: kraftb at kraftb.at (Bernhard Kraft) Date: Fri, 01 Mar 2013 21:09:31 +0100 Subject: [TYPO3-extbase] FLUIDTEMPLATE In-Reply-To: References: Message-ID: Hello ! Am 27.02.2013 06:03, schrieb Georg Ringer: >> My basic problem is the following: I do not want to modify the HTML >> templates we got from our designer. > > then you won't be happy with subparts or fluid. there is no magic > mapping. Of course you could do that as well. ;) Supbarts are fine with such a method. By using page.10 = TEMPLATE page.10 { ... workOnSubpart = DOCUMENT_BODY ... } The "TEMPLATE" object will return only something between tags. I am sure one can extend FLUIDTEMPLATE to behave like this. By using some viewhelper or similar. I think I will have to dig into this. Just wondering there is no ready-to-use solution ... have a nice weekend, Bernhard From eichelt at web.de Sat Mar 2 00:29:01 2013 From: eichelt at web.de (Stefan Reichelt) Date: Sat, 02 Mar 2013 00:29:01 +0100 Subject: [TYPO3-extbase] FLUIDTEMPLATE In-Reply-To: References: Message-ID: Hello Bernhard, On 01/03/2013 21:07, Bernhard Kraft wrote: > I know about those ... What I did until now is: > > > Complete Site Layout and Content here ... > > > This achieves my requirements. But I wonder if this is how it should be. Yes of course! Sorry, totally forgot about that little part. :) This is indeed a right way to do it and then inside of the section named content, the markup with the variables (and viewhelpers) containing the content you've assigned in your FLUIDTEMPLATE cObject. Additionally if your layout 'default' only contains the single line with the f:render tag, then you can scrap the whole layout and simply add the f:render itself to your main template. Infront or after the section it tries to render doesn't matter. > The problem with your approach is that the tag is rendered either > twice (once from TYPO3, the other time from the template) or that I have > to use a "template.html" without head tag. This way it is unusable when > not called via TYPO3 (So you can't handle it back to the designer). Indeed. Though it is also possible to tell your PAGE cObject with config.disableAllHeaderCode [1] to not add the usual html header. Although that means ignoring all the dynamic and fancy configurations you can achieve through typoscript (like including js or css files, meta data and so on). Have a nice weekend and kind regards Stefan [1] http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html From kraft at web-consulting.at Mon Mar 4 18:00:40 2013 From: kraft at web-consulting.at (Bernhard Kraft) Date: Mon, 04 Mar 2013 18:00:40 +0100 Subject: [TYPO3-extbase] FLUIDTEMPLATE In-Reply-To: References: Message-ID: Hello ! On 02.03.2013 00:29, Stefan Reichelt wrote: > Indeed. Though it is also possible to tell your PAGE cObject with > config.disableAllHeaderCode [1] to not add the usual html header. > Although that means ignoring all the dynamic and fancy configurations > you can achieve through typoscript (like including js or css files, meta > data and so on). [1] is not an option. Should I miss all the TYPO3 minimization, etc. options. I assume this will get handled by some viewHelpers in NEOS registering appropriate CSS and JS files for minimization. But anyways I found a solution to my (and probably many others) problem. Here a detailed explanation for people who would like to use the HTML templates they got from their designers in an almost unmodified (and DTD valid) form: Feel free to post this tutorial/example to some blog. I for myself am not in the posession of some blogging account. But be so kind and note my employer "webconsulting.at" as sponsor :) --------------- tutorial begin ------------------- Assume you got 3 templates. Every one with a different content area (2 columns, three columns, and 2 columns with a box on the top spanning the whole width but all 3 templates provided by your graphics/html agency share a common "drumherum" (surrounding). 1st thing to do: "Comment" out every tag by wrapping it with an tag. Thus the tag rendering is up to TYPO3. 2nd thing to do: Enclose the content area of every file with an tag. Each sharing the same "name" attribute. 3rd thing to do: Add an tag to every template. The tag should reference one of the three files - but must reference the SAME file every time (start.html is a good idea). A good location is between the (commented out) and tag. 4th thing to do: Only (and when I say only I mean ONLY) add a tag ONCE above the tag ONLY in the layout file (the ONE file you referenced from within the tag). read :) ----------------------- tutorial end ------------- ------------ example begin -------------- Assume three templates "start.html", "news.html" and "page.html". All three files get referenced from within "FLUIDTEMPLATE.file" property using a TypoScript CASE switch. start.html will act as a "layout" wrapper for all three content areas. ======= start.html / begin =========== Static HTML from design
...
Static HTML from design
News content with three columns
Static HTML from design
Normal page content with two columns
Hi, first of all sorry if this is not the right list, but there is no other list related to extbase (or I did not find it). Yesterday I struggled a lot with creating an extbase extension. Checkbox elements claim that they want booleans and not strings and so on. But my main problem is, that the model does not get validated but insreted into the database which results in query errors because the content is invalid. This is my controller action: /** * action new * * @param Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee * @dontvalidate * @return void */ public function newAction(Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee = NULL) { if (empty($newEmployee)) { $newEmployee = $this->createEmptyObject(); } $this->view->assign('newEmployee', $newEmployee); } /** * action create * * @param Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee * @return void */ public function createAction(Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee) { $this->employeeRepository->add($newEmployee); $this->flashMessageContainer->add('Your new Employee was created.'); $this->redirectToUri('/suche/fuer-arbeitnehmer/ihr-eintrag-vielen-dank.html'); } I tried removing the dontvalidate on the newAction but that results in: Could not ultimately dispatch the request after 101 iterations. Most probably, a @dontvalidate annotation is missing on re-displaying a form with validation errors. This is my model: class Tx_ArArbeitnehmer_Domain_Model_Employee extends Tx_Extbase_DomainObject_AbstractEntity { /** * Vorname * * @var string * @validate NotEmpty * @validate StringLength(minimum=1) */ protected $firstname = ''; /** * Nachname * * @var string * @validate NotEmpty * @validate StringLength(minimum=1) */ protected $lastname = ''; ... } I tried it with only NotEmpty and with the StringLength but whatever is entered in there, the model is saved (or at least tried). I would expecte the controller to return with validation errors. What am I doing wrong? -- Marco Behnke Software Developer Grepolis InnoGames GmbH Harburger Schlo?stra?e 28 (Channel 4) - 21079 Hamburg - Germany Tel +49 40 7889335-0 Managing Directors: Hendrik Klindworth, Eike Klindworth, Michael Zillmer VAT-ID: DE264068907 Amtsgericht Hamburg, HRB 108973 http://www.innogames.com ? marco.behnke at innogames.de