Good morning,
Is it possible somehow to take ONLY its content of a custom field without all the html structure?
Let me explain my need:
In the product sheet I have to enter the url address of a friend site (for example google.com).
To do this I am using the 'text area' custom field, because it is the simplest of all for the user who has to load data on the product sheet, he absolutely must NOT be able to do graphic formatting or other things.
Inside html > com_virtuemart > productdetails > default.php
enter this string to invoke the custom field:
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'box_wwwfriendly','class'=> 'box_wwwfriendly'));
Using this string obviously the entire html structure of the custom field appears to me, which I don't care about. I just need to be able to insert in a tag <a href="XXX"> the value entered in the custom field (for example www.googole.com)
Do you know how I can do it without having to install new modules and plugins?
Thanks for your interest.
you either need to make a copy of your template customfields.php
templates\gjc_template\html\com_virtuemart\sublayouts\my_customfields.php
and call it by echo shopFunctionsF::renderVmSubLayout('my_customfields',array('product'=>$this->product,'position'=>'box_wwwfriendly','class'=> 'box_wwwfriendly'));
then display what ever u want .. i.e. just the value
or in templates\gjc_template\html\com_virtuemart\sublayouts\customfields.php
make an else based on position - something like below .. not tested
e.g.
<?php if (!empty($product->customfieldsSorted[$position])) {
if($product->customfieldsSorted[$position][0]->layout_pos == 'box_wwwfriendly'){ ?>
<div class="box_wwwfriendly">
<?php
foreach ($product->customfieldsSorted[$position] as $field) {
if ( $field->is_hidden || empty($field->display) || $field->published = 0) continue;
echo $field->display;
}
}
?>
</div>
<?php }else{
//continue the original code
}