cancel
Showing results for 
Search instead for 
Did you mean: 

Odd issue with media url

Odd issue with media url

I have migrated a Magento 1.9.1.1 site to a Magento 2.2.2. site.  The {{media url="...."}} syntax seems to work fine, except for one product attribute.  All references in this one specific text area attribute do not resolve the media URLs.  However the same code works fine in other text area attributes on the same (or other) product pages.  Not sure how to deal with this. 

 

Any ideas would be greatly appreciated.

3 REPLIES 3

Re: Odd issue with media url

Could you please share your textarea code which are not working for you.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Odd issue with media url

Since my original post, I discovered that it is not just the one attribute field that is having the issue.  I have the issue with a second attribute as well.  However, there are other attributes where the same code works just fine.

 

Some sample HTML in the attribute field is as follows:

 

<div class="SupportDocHolderAdobeMain"><!--Catalog Sheet---------------------------------------->
<div class="SupportDocHolderCatalogSheet"><a href="{{media url="wysiwyg/graphics/DrainCleaning/DrumMachines/K400DrumMachine/Catalog.pdf"}}" target="_blank"><img class="SupportDocHeaderAdobe" src="{{media url="wysiwyg/AdobeDocs/Adobe_PDF_file_icon_32x32.png"}}" alt="" /></a>
<div class="SupportDocTextAdobe">
<ul>
<li><a class="ChangeLinkColor" href="{{media url="wysiwyg/graphics/DrainCleaning/DrumMachines/K400DrumMachine/Catalog.pdf"}}" target="_blank">Catalog Sheet</a></li>
</ul>
</div>
</div>
<!--Parts List------------------------------------>
<div class="SupportDocHolderPartsList"><a href="{{media url="wysiwyg/graphics/DrainCleaning/DrumMachines/K400DrumMachine/PartsList.pdf"}}" target="_blank"><img class="SupportDocHeaderAdobe" src="{{media url="wysiwyg/AdobeDocs/Adobe_PDF_file_icon_32x32.png"}}" alt="" /></a>
<div class="SupportDocTextAdobe">
<ul>
<li><a class="ChangeLinkColor" href="{{media url="wysiwyg/graphics/DrainCleaning/DrumMachines/K400DrumMachine/PartsList.pdf"}}" target="_blank">Parts List</a></li>
</ul>
</div>
</div>
</div>
<p><a name="support_documents"></a></p>

 

This is displayed as a tab on the product page.  As I said before, I have other tabs and the contact displays correctly on the FRONTEND, but in this field and one other field the media URLs don't get translated.  On frontend an example of the HTML is as follows:  

 

<img class="SupportDocHeaderAdobe" src="{{media url=" wysiwyg="" adobedocs="" adobe_pdf_file_icon_32x32.png"}}"="" alt="">

 

as you can see the media url syntax is not translated.  This is the same for all references in the fields that have the issue.

 

As far as the phtml that displays the tabs content, it is as follows:

 

<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Product information template
*
* @var $block \Magento\Catalog\Block\Product\View\ProductInfo
*/
?>
<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getStandardEquipment(), 'Standard Equipment') ?>

 

 

Re: Odd issue with media url

Any thoughts as to what is going on?