Grid fields not parsing early when early parsing enabled
Hey Low,
I'm passing output of a LV Grid field to the brilliant_retail:js method, but the grid field does not actually appear to be parsed early. It is passed to exp:brilliant_retail:js and removed from the template data. If the data stays in the template it eventually does get parsed. Resulting in the template tags being output in the javascript source.
I'm guessing this => Low Variables: Calling Low_grid::display_output() handles the actual grid parsing.
Template Debugger:
0.000010/5.2MB) - - Begin Template Processing -
(0.000036/5.2MB) - URI: create/anto/dress
(0.000047/5.2MB) - Path.php Template: /
(0.000060/5.2MB) - Retrieving Template
(0.000070/5.2MB) - Parsing Template URI
(0.003305/5.29MB) - Template Group Found: create
(0.003852/5.3MB) - Retrieving Template from Database: create/anto
(0.004565/5.3MB) - Template Found
(0.004654/5.31MB) - Retrieving Template from File
(0.008716/5.58MB) - Calling Extension Class/Method: Low_variables_ext/template_fetch_template
(0.011922/5.64MB) - Calling Extension Class/Method: Ce_cache_ext/template_pre_parse
(0.012231/5.61MB) - Template Type: webpage
(0.012258/5.61MB) - Parsing Site Variables
(0.012700/5.62MB) - Snippets (Keys): lv_price_classic|lv_price_dress|lv_price_sport|lv_adjust_collar|lv_adjust_cuff|lv_adjust_bib|lv_adjust_fly_front|lv_adjust_front_fabric|lv_adjust_pocket_two|lv_adjust_pocket_flap_one|lv_adjust_pocket_flap_two|lv_adjust_pocket_contrast|lv_adjust_sleeve_placket|lv_adjust_epaulette|lv_adjust_epaulette_contrast|lv_adjust_button_3mm|lv_adjust_button_4mm|lv_adjust_monogram_letter|logged_in_member_id|logged_in_group_id|logged_in_group_description|logged_in_username|logged_in_screen_name|logged_in_email|logged_in_ip_address|logged_in_location|logged_in_total_entries|logged_in_total_comments|logged_in_private_messages|logged_in_total_forum_posts|logged_in_total_forum_topics|global:env|global:env_full|cdn_url|gv_allow_checkout|freelancer_version|csm:action|csm:error|br_payment_layout|br_price_html|br_sale_price_html|br_shipping_layout|br_system_alert|br_system_message|sn_out_of_stock_message|site_id|site_label|site_short_name|last_segment|current_url|current_path|current_query_string|is_core
(0.012729/5.62MB) - Snippets (Values): |||20|20|100|15|15|5|7.50|15|5|5|5|5|5|10|4|1|1||david@codesly.com|David Dexter|david@codesly.com|127.0.0.1||1246|0|0|0|0|local|Local||y|FALSE||| {gateway_label} {if "{has_form}"} {gateway_form} {/if} |{price}| {price} {sale_price}
|
- {shipping_label} {if '{shipping_label}' != '' && '{shipping_label}' != 'Free Shipping'} {/if} {rates}
- - {if '{rate}' != ''} {rate} - {/if} {rate_label} {/rates}
× | {message}
× |This item is currently out of stock.|1|Anto Shirt|default_site|dress|http://local.antoshirt.com/create/ant...||
(0.013588/5.63MB) - Parse Date Format String Constants
(0.013606/5.63MB) - Parse Current Time Variables
(0.013729/5.64MB) - Parsing Segment, Embed, Layout, logged_in_*, and Global Vars Conditionals
(0.029098/5.99MB) - - Beginning Tag Processing -
(0.029138/5.99MB) - Parsing Tags in Template
(0.029170/6MB) - Tag: {exp:ce_cache:it page="anto-create" global="no"}
(0.029254/6MB) - Closing Tag Found
(0.029340/6MB) - Tag: {exp:brilliant_retail:js}
(0.029379/6MB) - Closing Tag Found
(0.029416/6MB) - Processing Tags
(0.029449/6.01MB) - Module Tag: Ce_cache/it
(0.029469/6.01MB) - Module Tag: Brilliant_retail/js
(0.029485/6.01MB) - Including Files for Plugins and Modules
(0.054778/7.78MB) - Files for Plugins and Modules All Included
(0.055545/7.81MB) - Beginning Final Tag Data Processing
(0.055569/7.81MB) - Calling Class/Method: Ce_cache/it
(0.055907/7.82MB) - -> Class Called: Ce_cache
(0.056094/7.83MB) - -> Method Called: it
(0.058707/7.92MB) - Parse Current Time Variables
(0.058799/7.93MB) - Parsing Segment, Embed, Layout, logged_in_*, and Global Vars Conditionals
(0.058870/7.93MB) - - Beginning Tag Processing -
(0.058886/7.93MB) - Parsing Tags in Template
(0.058909/7.93MB) - Tag: {exp:low_variables:parse var="lv_create_tuxedo_shirt"}
(0.058976/7.93MB) - Closing Tag Found
(0.059029/7.93MB) - Tag: {exp:brilliant_retail:cart_add_form form_id="cart_add"}
(0.059089/7.93MB) - No Closing Tag
(0.059122/7.94MB) - Processing Tags
(0.059151/7.94MB) - Module Tag: Low_variables/parse
(0.059171/7.94MB) - Module Tag: Brilliant_retail/cart_add_form
(0.059186/7.94MB) - Including Files for Plugins and Modules
(0.060304/8.01MB) - Files for Plugins and Modules All Included
(0.060910/8.04MB) - Beginning Final Tag Data Processing
(0.060930/8.04MB) - Calling Class/Method: Low_variables/parse
(0.061102/8.04MB) - -> Class Called: Low_variables
(0.061196/8.05MB) - -> Method Called: parse
(0.061240/8.05MB) - Low Variables: Getting variables from Database
(0.113230/11.83MB) - Low Variables: Calling Low_grid::display_output()
(0.129096/12.57MB) - -> Data Returned
(0.129155/12.57MB) - Calling Class/Method: Brilliant_retail/cart_add_form
(0.129255/12.57MB) - -> Class Called: Brilliant_retail
(0.152909/13.94MB) - -> Method Called: cart_add_form
(0.153339/13.94MB) - -> Data Returned
(0.153602/13.85MB) - - End Tag Processing -
(0.153720/13.85MB) - - Processing Sub Templates (Depth: 1) -
(0.153772/13.86MB) - -----List of Embeds: create/_preview,create/_selected_options
(0.153888/13.86MB) - -----Processing Sub Template: create/_preview
(0.153923/13.86MB) - -----Retrieving Template
(0.153955/13.86MB) - -----Retrieving Template from Database: create/_preview
(0.155649/13.86MB) - -----Template Found
(0.155861/13.88MB) - -----Retrieving Template from File
(0.156752/13.89MB) - -----Calling Extension Class/Method: Low_variables_ext/template_fetch_template
(0.157049/13.89MB) - -----Calling Extension Class/Method: Ce_cache_ext/template_pre_parse
(0.157438/13.87MB) - -----Template Type: webpage
(0.157577/13.87MB) - -----Parsing Site Variables
Replies
Low 16 Sep 2014 18:56
Having early parsing enabled/disabled only applies to vars in variable syntax. If you're using tag syntax, which you need to do when outputting Grid/Matrix vars, early parsing is irrelevant; they're tags, so parsed as tags. Before late parsed vars, after early parsed vars.
If the brilliant_retail:js tag removes exp-tags from itself, and then puts it back, but with the curly braces encoded, then there's not a lot LV can do.
Is that what's the case here?
dpdexter 16 Sep 2014 19:10
I figured. So the long and short answer is that LV doen't actually early parse grid fields.
Low 16 Sep 2014 19:15
That's one way of looking at it. Inevitable with EE's template engine, really.
dpdexter 16 Sep 2014 19:16
Thanks Low.
dpdexter 16 Sep 2014 21:10
In the very rare case that anyone stumbles upon this again I wanted to mention we added a config variable to the exp:brilliant_retail:js tag that allows for late template parsing. The js method will get the raw tag data (as expected) but run the final stored data through an instance of the parser and whala... works.
$config["br_parse_js"] = 'y';
Does the trick in BR 2.7.1+
Thanks...