[TYPO3-commerce] pi3 & pi4 template consistency

Jordan Schaan jordan at sensolutions.com
Wed Oct 17 00:02:04 CEST 2007


Hi all,

In this email I'm trying to point out the inconsistencies between how pi3  
and pi4 handle their templates in regards to the user address forms. I  
offer a possible solution and hope that it might be considered for being  
added to the main project.

Here's some background;

I'm customizing the 'address' templates (billing, delivery, and the user  
address add/edit/delete ones) for the checkout process have run into some  
problems after finishing the template for pi3 and trying to apply some of  
the same template code for pi4. I'll quickly explain how pi3 and pi4  
differ in their approaches;

pi3 substitutes like this;
--------------------------
<!-- ###ADDRESS_CONTAINER### begin -->
  ...
    ###ADDRESS_FORM_INPUTFIELDS### [ replaced by "###SINGLE_INPUT###" for  
every address field ]
...
<!-- ###ADDRESS_CONTAINER### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_LABEL###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->
--------------------------

while p4 substitues like this;
--------------------------
<!-- ###ADDRESS_EDIT_FORM### begin -->

    ###LABEL_NAME### ###FIELD_NAME### [ replaced by "###SINGLE_INPUT###" ]

    ###LABEL_SURNAME### ###SURNAME_NAME### [ replaced by  
"###SINGLE_INPUT###" ]

    [ ... and so on for the rest of the address fields ]
<!-- ###ADDRESS_EDIT_FORM### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->

--------------------------

Here are some thoughts one these;Hi all,

In this email I'm trying to point out the incositencies between how pi3  
and pi4 handle thier templates in regards to the user address forms. I  
offer a possible solution and hope that it might be considered for being  
added to the main project.

Here's some background;

I'm customizing the 'address' templates (billing, delievery, and the user  
address add/edit/delete ones) for the checkout process have run into some  
problems after finishing the template for pi3 and trying to apply some of  
the same tempalte code for pi4. I'll quickly explain how pi3 and pi4  
differ in thier approches;

pi3 substitues like this;
--------------------------
<!-- ###ADDRESS_CONTAINER### begin -->
  ...
    ###ADDRESS_FORM_INPUTFIELDS### [ replaced by "###SINGLE_INPUT###" for  
every address field ]
...
<!-- ###ADDRESS_CONTAINER### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_LABEL###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->
--------------------------

while p4 substitues like this;
--------------------------
<!-- ###ADDRESS_EDIT_FORM### begin -->

    ###LABEL_NAME### ###FIELD_NAME### [ replaced by "###SINGLE_INPUT###" ]

    ###LABEL_SURNAME### ###SURNAME_NAME### [ replaced by  
"###SINGLE_INPUT###" ]

    [ ... and so on for the rest of the address fields ]
<!-- ###ADDRESS_EDIT_FORM### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->

--------------------------

Here are some thoughts one these;
1. In pi4 the label is always before or in front of both your input and  
your error which is not very flexible (pi3 doesn't have this problem  
because all 3 markers are defined in the same subpart)
2. In pi4 the order in which you define the fields in the template  
MATTERS, where as in pi3 the order would be derived from typoscript  
(please correct me if I'm wrong on this point). I would argue that being  
able to define the order in the template is better because, although, it  
does require the user to add a marker in the template if someone adds a  
field in typoscript, it gives the template designer more flexibility  
without having to go change the typo3 script.

A potential compromise would be to combine these two as follows;
--------------------------
<!-- ###ADDRESS_CONTAINER### begin -->
  ...
    ###ADDRESS_FORM_INPUTFIELDS### [ replaced by "###ADDRESS_EDIT_FORM###" ]
...
<!-- ###ADDRESS_CONTAINER### end -->


<!-- ###ADDRESS_EDIT_FORM### begin -->

    ###LABEL_NAME### ###FIELD_NAME### [ replaced by "###SINGLE_INPUT###" ]

    ###LABEL_SURNAME### ###SURNAME_NAME### [ replaced by  
"###SINGLE_INPUT###" ]

    [ ... and so on for the rest of the address fields ]
<!-- ###ADDRESS_EDIT_FORM### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_LABEL###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->

--------------------------


Finally, there are also some inconsitencies with wrapping functions being  
used. For example pi3 wraps both ###FIELD_ERROR### and the manditory flag  
while pi4 does not.

If you have any comments or want me to implement this please let me know.
Thanks for reading!
Jordan


1. In pi4 the label is always before or in front of both your input and  
your error which is not very flexable (pi3 doesn't have this problem  
because all 3 markers are defined in the same subpart)
2. In pi4 the order in which you define the fields in the template  
MATTERS, where as in pi3 the order would be derived from typoscript  
(please correct me if I'm wrong on this point). I would argue that being  
able to define the order in the template is better because, although, it  
does require the user to add a marker in the template if someone adds a  
field in typoscript, it gives the template designer more flexability  
without having to go change the typo3 script.

A potential compromise would be to combine these two as follows;
--------------------------
<!-- ###ADDRESS_CONTAINER### begin -->
  ...
    ###ADDRESS_FORM_INPUTFIELDS### [ replaced by "###ADDRESS_EDIT_FORM###" ]
...
<!-- ###ADDRESS_CONTAINER### end -->


<!-- ###ADDRESS_EDIT_FORM### begin -->

    ###LABEL_NAME### ###FIELD_NAME### [ replaced by "###SINGLE_INPUT###" ]

    ###LABEL_SURNAME### ###SURNAME_NAME### [ replaced by  
"###SINGLE_INPUT###" ]

    [ ... and so on for the rest of the address fields ]
<!-- ###ADDRESS_EDIT_FORM### end -->


<!-- ###SINGLE_INPUT###  begin -->
     ###FIELD_ERROR###
     ###FIELD_LABEL###
     ###FIELD_INPUT###
<!-- ###SINGLE_INPUT### end -->

--------------------------


Finally, there are also some inconsistencies with the wrapping functions  
being used. For example pi3 wraps both ###FIELD_ERROR### and the manditory  
flag while pi4 does not.

If you have any comments or want me to implement this please let me know.
Thanks for reading!
Jordan


More information about the TYPO3-project-commerce mailing list