Übercart Catalog-weergave aanpassen (Drupal)
In de loop der jaren kwam ik regelmatig situaties tegen waarin het handig was als ik Übercart Catalog-pagina's naar m'n hand kon zetten. Helaas is me dat tot op heden nooit gelukt.
Pager inbouwen - Drupal 6
In oktober 2015 kwam weer een situatie voorbij waarbij het handig is als ik de Catalog-weergave kan aanpassen. Zie de afbeelding hiernaast. Dit betreft Drupal 6 Echter: De migratie naar Drupal 7/8 staat voor de deur, dus ik sla het nu over.
Eigen Catalog-View - Drupal 7
Dit is een geëxporteerde Drupal 7 Catalog View [1]:
$view->base_table = 'node'; $view->human_name = ''; $view->core = 0; $view->api_version = '3.0-alpha1'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ /* Display: Defaults */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->display->display_options['title'] = 'Products'; $handler->display->display_options['access']['type'] = 'none'; $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['query']['options']['query_comment'] = FALSE; $handler->display->display_options['exposed_form']['type'] = 'basic'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['style_plugin'] = 'grid'; $handler->display->display_options['style_options']['fill_single_line'] = 1; $handler->display->display_options['row_plugin'] = 'fields'; /* Field: Content: Title */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'node'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['link_to_node'] = 1; /* Field: Product: Sell price */ $handler->display->display_options['fields']['sell_price']['id'] = 'sell_price'; $handler->display->display_options['fields']['sell_price']['table'] = 'uc_products'; $handler->display->display_options['fields']['sell_price']['field'] = 'sell_price'; /* Field: Product: Buy it now button */ $handler->display->display_options['fields']['buyitnowbutton']['id'] = 'buyitnowbutton'; $handler->display->display_options['fields']['buyitnowbutton']['table'] = 'uc_products'; $handler->display->display_options['fields']['buyitnowbutton']['field'] = 'buyitnowbutton'; /* Field: Broken/missing handler */ $handler->display->display_options['fields']['uc_product_image_fid']['id'] = 'uc_product_image_fid'; $handler->display->display_options['fields']['uc_product_image_fid']['table'] = 'node_data_uc_product_image'; $handler->display->display_options['fields']['uc_product_image_fid']['field'] = 'uc_product_image_fid'; $handler->display->display_options['fields']['uc_product_image_fid']['label'] = ''; /* Filter criterion: Content: Published */ $handler->display->display_options['filters']['status']['id'] = 'status'; $handler->display->display_options['filters']['status']['table'] = 'node'; $handler->display->display_options['filters']['status']['field'] = 'status'; $handler->display->display_options['filters']['status']['value'] = 1; $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE; /* Filter criterion: Node: Is a product */ $handler->display->display_options['filters']['is_product']['id'] = 'is_product'; $handler->display->display_options['filters']['is_product']['table'] = 'uc_products'; $handler->display->display_options['filters']['is_product']['field'] = 'is_product'; $handler->display->display_options['filters']['is_product']['value'] = 1; $handler->display->display_options['filters']['is_product']['expose']['operator'] = FALSE; /* Display: Page */ $handler = $view->new_display('page', 'Page', 'page_1'); $handler->display->display_options['path'] = 'products';
Bronnen
- https://www.google.com/search?q=drupal+6+edit+ubercart+catalog+view - Aardige query
- https://drupal.org/node/1201796 - Drupal 7 and drupal 6 ubercart catalog display
- http://drupalsn.com/learn-drupal/drupal-questions/question-4319 - Aardig overzicht van het issue, maar de link naar concrete voorbeeld werkt niet
- https://drupal.org/project/uc_views - Een verzameling handige Views voor Ubercart 2, maar niet wat ik zoek
- http://stackoverflow.com/questions/3059268/how-to-theme-catalog-page-in-ubercart - Suggereert Views+Advanced Catalog modules. Dat heb ik uitgeprobeerd, maar is niet wat ik zoek.
- http://www.ubercart.org/forum/support/7721/drupal_6x_ubercart_creating_custom_catalog_view
- http://www.ubercart.nl/forum/support/22455/list_nodes_taxonomy_page_pager_limit - Lynn:
There are two views involved in building the catalog pages, one for products and one for terms. The products view is simply called "Catalog", and it should be easily found on the view administration page.
- Dat kon ik helaas niet terugvinden
The most efficient way is to edit the Ubercart catalog view (go to yoursite/admin/build/views). Look for the Style option under Basic Settings, click it, and change the setting from Grid or Table to List (or theme the view)
en
I'd suggest you to use Views+Advanced Catalog modules. It's really better alternative for "out-of-box" Ubercart catalog.