drupal - How to place custom views area handler into views header programatically? -
I had to complete a task by creating a custom view area handler. It all works fine, and I want to send the handler to the header I can keep it in the area. Unfortunately, due to the structure of the deployment on this project, I simply can not update the code related to the scene. To create my module custom area handler, it also requires changing the scene to place the area handler in the header.
I have made the scene area handler properly with the following code:
/ ** * applies hook_views_data (). * * Purpose: Install an idea area handler to display. * / Function custom_shipping_notification_views_data () {// start data array $ data = array (); // Define a handler for the area used to define a vessel, where the free ship is worth $ 'data [' commerce_der '] [' free_shipping_smus'] = array ('title' = & gt; ; T ('Free Shipping Notification'), 'Help' => (T. 'Displays Free Shipping Information on Cart Form'.), 'Field' = & gt; Array ('Handler' = & gt; ; 'Custom_shipping_notification_handler',),); // Return data $ data return; }
All this works, so I can not even get it in the handler. I can not keep any problem through the UI UI I have to put it in the header of a specific view. This view is managed in the features but due to client deployment and repo structure, I can not change the feature reasonably. I want to change the view from within my module containing custom fields the wanted.
I have not tried to take any advantage of this code:
function custom_shipping_notification_views_pre_build (& amp; see $) {if ($ view-> name = = 'Commerce_cart_form') {$ id = $ view-> Add_item ('default', 'header', 'views', 'free_shipping_message'); }}
Anyone have any ideas? I'm clearly in the infected area because the add_item method has a line description, and there is no coding example. Most of the documents around this area are equally undeveloped.
function YOURMODULENAME_views_pre_view (& amp; $ view, & Amp; $ display_id, & amp; $ Args) {if ($ view-> name == 'YOURVIEWNAME' & amp; $ display_id == 'YOURDISPLAYID') {$ footer = "This is the text that I want my footer !!!!" ; $ Options = array ('id' = & gt; 'field', 'table' = & gt; 'idea', 'field' = & gt; field ',' empty '= & gt; wrong, = & Gt; $ footer, 'format' = & gt; 'filtered filter', 'tokenize' => 0,); $ View- & gt; Set_item ('YOURDISPLAYID', 'footer', 'field', $ option); }}
Comments
Post a Comment