Results 1 to 6 of 6

Thread: Change template - $this->fields

  1. #1
    New user
    Join Date
    09-20-15.
    Posts
    19

    Default Change template - $this->fields

    Hello Community.

    I am using Contao 4.3.1

    is it possible to change the templates for
    PHP Code:
    $this->fields
    in de templates like "mod_password"?

    Thanks

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    You can try to build it up by yourself with the variables from the template.
    PHP Code:
    <?php
    $this
    ->showTemplateVars();
    ?>
    But it's not as easy. You will need the captcha and more. And you don't know exactly which values arrive at different states.

    What are you trying to do? Maybe you can modify it by PHP string replace or with JS.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    New user
    Join Date
    09-20-15.
    Posts
    19

    Default

    i would like to change the complete formfields like the "mod_login" thare i can change it to my needs.

    I have a HTML template that i want to use and trying to make it like the HTML template.

    I have a JS solution now but i dont like it because you can see the form changen when the page is loading.

    I going to look into "$this->showTemplateVars()"

  4. #4
    New user
    Join Date
    09-20-15.
    Posts
    19

    Default

    The "templatevars['fields']" are plain HTML.
    is this not generated with php like " $this->fields['email']->generateWithError()" which i found on the DE forum?

  5. #5
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    There are multiple form_-Templates which you can try to change.

    With JS you can set your form to display:none first and when JS has finished set it to display:block, or use opacity. Maybe with transition.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  6. #6
    New user
    Join Date
    09-20-15.
    Posts
    19

    Default

    Thanks Andreas,

    I have taken your advice and made it "display:none" until page has been fully loaded.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •