310 Posts
ricco
9 years ago
2
Topic

Hi,

My first question is: can we include php in the HTML typo of a field (#2)? I've tried and it the answer is yes but some how its different from the code we put in the template position overrides.

I have an ads website and I'm showing a price in my content and intro views of the main content type. I've achieved what I want in this views by a custom position template overrides, this is the code:

<div>
<div>
Price:
</div>
<?php
// get the checkbox values
$options = $cck->getValue('rf_price_options');
// create an array of the values
$optarray = explode(",",$options);
// verify if x value is in the array, if yes display another field
if (in_array("On request", $optarray)) { ?>
<div style="float: left; font-weight: bold; color: #F35E5E;" >
<?php echo $cck->getValue('rf_price_options'); ?>
</div>
<?php } else { ?>
<div style="float: left; font-weight: bold; margin-right: 3px; color: #F35E5E;" >
<?php echo $cck->getValue('rf_price_from'); ?>
</div>
<div style="float: left; font-weight: bold; margin-right: 3px; color: #F35E5E;" >
<?php echo $cck->getValue('rf_price'); ?>
</div>
<div style="float: left; font-weight: bold; color: #F35E5E;" >
<?php echo $cck->getValue( 'rf_listing_currency' ); ?>
</div>
<? } ?>
</div>

In the form where the price is entered there is an option for the submitter to select if the price will be entered or if it will be told to the viewer on request.

For example:

Price: 5 EUR

or

Price: On request

There is also an option for the submitter to select if the entered price starts FROM the price entered:

For example:

Price: from 5 EUR

I'm trying to include the above code in the item view of a search type with the seb_table template, but as there is no position overrides for this template I don't know how to include it.

Could you advise me please?

Thank you,
Regards,
Ricco

Need some help?

2 replies have been added to this thread, and the topic is marked as solved.
You should subscribe to a club in order to read all posts.