AbanteCart Community

AbanteCart Development => Extensions and Add-Ons => Topic started by: gob33 on December 24, 2013, 01:17:42 PM

Title: Customizing an extension page: create tabs
Post by: gob33 on December 24, 2013, 01:17:42 PM
I would like to know if it is possible to use JQuery UI tabs on an extension edit page ?
The purpose is to split extension infos on many tabs (general, settings, about, ...) on the same page.

Today "extensions_edit.tpl" is the template inside AbanteCart which displays the basic settings, the other settings are set with an "Additionnal' button on a new page (custom .tpl and controller).

Is it possible for a developper to modify/extend "extensions_edit.tpl" ?
Or does the extension edit page is fixed and always in the same table format for all AbanteCart extensions ?
Title: Re: Creating tabs on an extension page
Post by: abantecart on December 24, 2013, 07:55:24 PM
Technically it is possible. Do you suggest this for core extension settings interface?
Title: Re: Creating tabs on an extension page
Post by: gob33 on December 24, 2013, 08:11:40 PM
Say that it is more convenient way to have multiple tabs on the page of an extension than opening new window(s). And I do not see how I can work around "extensions_edit.tpl" as it is written and part of the admin. Each dev who writes an extension should have full control of how to show and present its diverse settings (tabs, accordion,...) on the edit page.
Title: Re: Creating tabs on an extension page
Post by: abantecart on December 26, 2013, 07:42:27 AM
You can override the edit page. Check how it is done in PayPal extensions on version 1.1.7. Extension admin page is completely overridden by extension.

See set up in config and main of extension:
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_pp_standart/config.xml
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_pp_standart/main.php

Code: [Select]
        <custom_settings_template>pages/extension/default_pp_standart_settings.tpl</custom_settings_template>
and
Code: [Select]
$templates = array(
    'storefront' => array(
            'responses/default_pp_standart.tpl' ),
    'admin' => array(
                'pages/extension/default_pp_standart_settings.tpl'
        )
);

And template:
https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_pp_standart/admin/view/default/template/pages/extension/default_pp_standart_settings.tpl

If you manage tab approach, please share. We consider improving it on core level.
Title: Re: Creating tabs on an extension page
Post by: eCommerce Core on December 27, 2013, 08:13:01 AM
gob33. I wonder if this worked for you
Title: Re: Creating tabs on an extension page
Post by: gob33 on January 04, 2014, 06:26:06 PM
For the moment, Im still reading your code and try to understand.
Yes, the extensions_edit.tpl can be overridden, but template datas always issuing from extensions.php (I dont know the role of controller/pages and responses).
Whereas the tabs you use, they are different from JQuery UI tabs by reloading the page each time you click one.
Title: Re: Creating tabs on an extension page
Post by: abantecart on January 06, 2014, 08:24:25 AM
Controller pages are for admin or storefront templates and response controllers are for AJAX
Title: Re: Creating tabs on an extension page
Post by: gob33 on January 06, 2014, 01:02:15 PM
Ah ok, i didnt find infos about that in the wiki.

Another point about customizing settings: is it normal that in UPS and USPS shipping extensions (that im using as exemples), i have only basic settings on 1.1.7 ?
Or is it due to config.xml and automatic fields creation ?

Title: Re: Creating tabs on an extension page
Post by: gob33 on January 07, 2014, 09:17:26 AM
It is the same problem with shipping by weight: extensions_edit.tpl takes over the default_weight.tpl
Title: Re: Creating tabs on an extension page
Post by: gob33 on January 08, 2014, 05:14:56 AM
That system of extensions with config.xml is no good.

It is supposed to simplify developping extensions by automatic creation of ressources but it lacks flexibility for designing custom pages. The page build process should be done inside each extension the way the dev wants it to be and not be done by the core which leads to uniformity and dependance.
Title: Re: Creating tabs on an extension page
Post by: abantecart on January 10, 2014, 08:15:30 AM
I am not clear with your comment. Is this related to this post or something else?  config.xml is not for building custom pages. This file to configure extension.

Please create new post related to this new topic and we will discuss.  If improved process need we will build it.
Title: Re: Creating tabs on an extension page
Post by: gob33 on January 10, 2014, 12:00:12 PM
Yeah, I deviated a little from the topic title.

Just do you agree many details settings are not displayed on 1.1.7 for some shipping modules (UPS, USPS, ...) but present in extension's code ?

Ex for USPS: https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_usps/admin/controller/pages/extension/default_usps.php
Where are these fields on page ?

Should i open a new thread ? Im asking why nobody report it ???
Title: Re: Customizing an extension page: create tabs
Post by: llegrand on January 10, 2014, 02:58:03 PM
In your last post regarding settings for UPS  USPS, etc,  are you saying you think there are additional options in the code that do not show up on the Additional information pages?  Or have you not found the additional info pages for the settings?  Made a screen shot so you know where I am talking about.

Just curious as to what your issue is reporting.
Lee


Title: Re: Customizing an extension page: create tabs
Post by: gob33 on January 10, 2014, 05:07:10 PM
Thx Ilegrand, your shot showed me the way.
I didnt see the additional button because i didnt put the extension "ON" and button stay hidden.
It's ok now, I mistaken because I used to see all settings on same page on other carts even when disabled. I didnt understood basic settings were done by the core and additionnals by extension controller.