$tree->fid('pictures')->find('li')->iter3(\@pics, \&details_list_element);
$tree->fid('jsonld')->replace_content(encode_json product_to_schemaorg '', %data);
+ $tree->fid('dd_stock')->replace_content($data{stock});
+ $tree->fid('dd_price')->replace_content(stringify_money $data{price});
+ for (qw/brand model/) {
+ if ($data{$_}) {
+ $tree->fid("dd_$_")->replace_content($data{$_});
+ } else {
+ $tree->fid("dt_$_")->detach;
+ $tree->fid("dd_$_")->detach;
+ }
+ }
+
for my $ahref ($tree->find('a')) {
$ahref->attr(href => "/form?highlight=$id") if $ahref->attr('href') eq '/';
}
<h2>Item</h2>
<p>Go to <a href="/">order form</a>.
+<dl>
+<dt id="dt_brand">Brand</dt><dd id="dd_brand"></dd>
+<dt id="dt_model">Model</dt><dd id="dd_model"></dd>
+<dt>Stock</dt><dd id="dd_stock"></dd>
+<dt>Price</dt><dd id="dd_price"></dd>
+</dl>
<div id="summary"></div>
<ul id="pictures"><li><a href="https://example.org"><img src="https:/example.org"></a></ul>