How to can I use an own layout for coupondelete view?


  • Default avatar
    gerald.bader    
     6 years ago
    0

    Hi!

    There is a view 'coupondelete' with a 'default' layout.
    I need to create and use an own layout for that view.
    Where can I choose my own layout?

    Kind regards,
    Gerald
  • Your avatar
    seyi    
     6 years ago
    0

    Hi,

    Copy the file:

    www/components/com_awocoupon/views/coupondelete/tmpl/default.php

    to

    www/templates/[YOUR_TEMPLATE]/html/com_awocoupon/coupondelete/default.php

    And make the modifications there.

  • Default avatar
    gerald.bader    
     6 years ago
    0

    Hi!

    Thank you for your reply.
    Actually I do not want to create an override, but I want to create an own layout.
    Where can I choose, whether to use the default.php or mylayout.php?

    Kind regards,
    Gerald
  • Your avatar
    seyi    
     6 years ago
    0

    There is no option for selecting layouts.  The system looks for defaut.php always.  Is this something you will be switching often?  If not, then using an override should work fine.
  • Default avatar
    gerald.bader    
     6 years ago
    0

    Hi!

    This is concerning VM templating, though - but it is an essential post in a thread about good templating:
    Re: How to choose an own layout for online order view?

    The essence of this thread is:
    Do not override default.php, but create your own layout.
    So an option to select own layout would be necessary.
    BTW: This is usual with Joomla (see Layout Overrides in Joomla)

    Kind regards,
    Gerald
  • Your avatar
    seyi    
     6 years ago
    0

    In the file www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler, around line 421 is this:
    <?php
                    $coupondelete_view
    ->coupons $display_arr;
    ?>


    Right before that add this:
    <?php
                    $coupondelete_view
    ->setLayout$this->params->get('virtuemart_coupondelete_layout','default') );
    ?>


    Now to load your own layout, in the database add the sql statement:
    insert into #__awocoupon_config ( name, value ) values ( 'virtuemart_coupondelete_layout', 'my_own_layout' );


    You will need to change #_ to your own prefix and my_own_layout to your layout name.


  • Default avatar
    gerald.bader    
     6 years ago
    0

    Won't this hack be overwritten with the next update?
  • Your avatar
    seyi    
     6 years ago
    0

    No, it will not, the code will be part of future updates.
  • Default avatar
    gerald.bader    
     6 years ago
    0

    Thank you!