VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: fabioweb on June 16, 2020, 22:27:15 PM

Title: Get content from custom fields [SOLVED]
Post by: fabioweb on June 16, 2020, 22:27:15 PM
Hello with V.M. 3.8.2 i have this code in product details
$linkVideo = shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'videobreve'));
and the output of echo $linkVideo custom field is

<div class="product-fields">
   <div class="product-field product-field-type-S">
   <div class="product-field-display">[b]https://www.ilgarofanorosa.com/video/ita.mp4[/b]</div>
    </div>
<div class="clear"></div>
</div>


My question is how can i have only the content of custom field ino order that
<a href="<?php echo $linkVideo"></a> will be only the link?

Thanks for help




Title: Re: Get content from custom fields
Post by: pinochico on June 16, 2020, 22:34:29 PM
change sublayouts customfields by override in template or create new sublayout and change/call in $linkVideo
Title: Re: Get content from custom fields
Post by: fabioweb on June 17, 2020, 14:38:58 PM
Wow perfect thanks! i want to share the final code for this
echo shopFunctionsF::renderVmSubLayout('customfields_link',array('product'=>$this->product,'position'=>'imparare'));
then i created customfields_link.php into sublayouts folder.

Best regards
Title: Re: Get content from custom fields [SOLVED]
Post by: pinochico on June 17, 2020, 18:12:41 PM
Wonderfull, that is exactly what i mean :)

Super
Title: Re: Get content from custom fields [SOLVED]
Post by: PRO on June 17, 2020, 18:33:43 PM
You dont need a separate file. You can have them separate in the customfields layout, by class , position etc.

http://forum.virtuemart.net/index.php?topic=128936.0