Results 1 to 7 of 7

Thread: Use different EditView.tpl

  1. #1
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Use different EditView.tpl

    I want to make some modifications to EditView.tpl

    I have copied it to custom/include/EditView/EditView.tpl

    The file is set in MVC/View/views/view.edit.php

    I could modify that to point to my new template but would prefer to do it in an upgrade safe manner

    Is there a way to do this?

    I want all modules to use the new template otherwise I would create individual view.edit files
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Use different EditView.tpl

    You could take a look on users' module (/modules/Users/) there is defined its own editview.tpl. Maybe you can check how itr was done and make your own.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Use different EditView.tpl

    Quote Originally Posted by rafael.q.g@hotmail.com View Post
    You could take a look on users' module (/modules/Users/) there is defined its own editview.tpl. Maybe you can check how itr was done and make your own.
    Thanks

    I can do it in individual modules using view.edit but I want to use my revised template in all modules
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  4. #4
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Use different EditView.tpl

    You would need to add a view.edit.php file in each module you want to use your template, overriding the preDisplay() method like so:

    PHP Code:
    function preDisplay()
    {
        
    parent::preDisplay();
        
    $this->ev->tpl 'yourtplfile.tpl';

    John Mertic
    Sugar Community Manager

  5. #5
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Use different EditView.tpl

    yup that would work but I was looking for a way that avoided that
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  6. #6
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Use different EditView.tpl

    That's pretty much it from an upgrade-safe approach. If you are willing to sacrifice that, you could change the template being used in the EditView2.php file directly.
    John Mertic
    Sugar Community Manager

  7. #7
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Use different EditView.tpl

    Quote Originally Posted by jmertic View Post
    That's pretty much it from an upgrade-safe approach. If you are willing to sacrifice that, you could change the template being used in the EditView2.php file directly.
    I've changed it in MVC/View/views/view.edit.php

    not upgrade safe but simple

    what i'm doing is adding a JavaScript file to all EditView's
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Editview pop-up
    By warmachine in forum Developer Help
    Replies: 4
    Last Post: 2010-07-30, 02:34 PM
  2. Replies: 3
    Last Post: 2010-07-27, 12:38 PM
  3. How to use set_return_and_save_background in editview?
    By flymirco in forum Developer Help
    Replies: 0
    Last Post: 2009-07-30, 02:57 PM
  4. To Get Value From Editview
    By aswath28 in forum Developer Help
    Replies: 0
    Last Post: 2008-11-11, 11:51 AM
  5. Where did EditView.php go in 5.0?
    By chad.hutchins in forum Developer Help
    Replies: 9
    Last Post: 2007-12-21, 02:58 PM

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
  •