[TYPO3-team-templavoila] RFC: #4200: Shortcut page must show content when kb_tv_cont_slide in used

Steffen Kamper info at sk-typo3.de
Mon Dec 7 12:38:39 CET 2009


Hi Dmitry,

Dmitry Dulepov schrieb:
> Hi!
> 
> I like the idea but I do not like magic constants. In 6 months nobody is 
> going to remember what this means:
> 
> +                    if (in_array($doktype, $handleDoktypes)) {
> +                        $doktype = 1;
> +                    }
> 
> There should be at least a comment explaining what's going on here and 
> what "1" means.  I would prefer a class constant but comment would do too.
>

i agree, though the concept of render dokTypes in general looks really 
magic, i don't like methods with names content a variable value 
(renderDoktype_xyz), but this is done this way so we have to handle it.


> Also you can make this code shorter by using t3lib_div::inList():
> 
yes, good idea.

> +                    $handleDoktypes = t3lib_div::trimExplode(',', 
> $this->modTSconfig['properties']['doktypesRenderAsEdit'], TRUE);
> +                    if (in_array($doktype, $handleDoktypes)) {
> 
> All together become something like:
> 
>     $docTypesToEdit = $this->modTSconfig['properties']['pageTypesToEdit'];
>     if ($docTypesToEdit && t3lib_div::inList($docTypesToEdit, $doktype)) {
>         // Make sure it is editable by page module
>         $doktype = self::DOKTYPE_ABCD;
>     }
> 
> I also changed TS property name from doktypesRenderAsEdit to 
> pageTypesToEdit because previous was hard to remember for 
> non–programmers, who do not know what "doktype" is.
>

I also agree for better naming. But for typoscript users should know 
doktype as you may need the value eg for menus. I never understood this 
name: doctype is used for HTML, the "k" is a german thing, pageTypes are 
used in other context (typeNum) etc, so doktype is a very unlucky name.

Maybe we find a better naming? pageRenderType?

vg Steffen


More information about the TYPO3-team-templavoila mailing list