0

In content/page homepage I insert a widget from the porto theme:

{{block class="Smartwave\Filterproducts\Block\Home\LatestList" name="latest_product" 
product_type="4" product_count="50" category_id="2" aspect_ratio="1" image_width="300" image_height="300" 
template="grid.phtml"}}

The template file grid.phtml is in

app/design/frontend/Smartwave/porto/Smartwave_Filterproducts/templates/grid.phtml

I am modifying the product link so it opens in a new tab:

**Origin**
<a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1">
**Modified**
<a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1" target="_blank">

I then run the following commands from a bash script:

rm -rf ../var/* &&
rm -rf ../pub/static/ &&
php ../bin/magento setup:upgrade &&
php ../bin/magento setup:static-content:deploy en_GB en_US --theme  Smartwave/porto -f &&
chown -R muser:mgroup ../ &&
../bin/magento cache:flush &&
service varnish restart

However after that when I inspect the source code on the page where the widget is inserted the target="_blank" is still missing.

Is there something in the deployment that I forget?

I am on Magento 2.3.4 and the active theme is Smartwave/porto

  • if you are in development mode and full page cache is disabled you do not need to do anything. You should see the template change as soon as you save the template. Turn on template hints so you can be 100% sure you are editing the right file. – paj Feb 1 at 18:14
  • yes that's what I did and the hints show me that I edit the correct file. Totally lost haha – Vincent Teyssier Feb 2 at 3:20
0

OPCache was enabled and caching the data.

service php7.3-fpm restart

And everything is good :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.