Hi guys - my first post here

I've been wrestling with k2 for a day or so now. Good times. I googled allowing a default value in an extra field to contain HTML (wanted to output a table structure for completion...). I came across this topic instead and thought I might share what I've done as an alternate method to get around the items discussed in this post.
fair warning: I'm no coder, barely conversant with php in the scheme of things and this code may well be the root of all evil. I can't seem to find the preview button, so I hope I can post-post edit
General idea: k2 presumes you want to loop out all your extra fields in one fell swoop. Largely, this is the case for me, but there's a few fields I want to do other stuff with (say, a property ID!). In that case, I need to exclude certain extra fields from the main loop AND get values from those excluded fields for use elsewhere *without* looping.
Step 1: set up an exclusion list and set up some vars up front that I'll use later.
/*
prepare specific blocks.
Instead of traversing array every time for ONE custom field, loop once and setup code output.
custom field exceptions - those fields we don't want output in the usual fashion */
$fieldexceptions = "|Property Tagline|Property ID|Main Image|Main Image Caption";
$enquire = "<a href='http://www.mydomainname.com.au/enquiries.php?apart=".$this->item->title."' title='Enquire about ".$this->item->title."'>Enquire Now</a>";
$shortlist = "";
$booknow = "";
$tagline = "";
$mainimage = "";
$mainimagecaption = "";
if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)) {
foreach ($this->item->extra_fields as $key=>$extraField){
if($extraField->value) {
if ($extraField->name == "Property ID") {
$shortlist = "<a href=\"javascript:addpropertytoshortlist(".$extraField->value.",'".$this->item->title."','".$this->item->link."')\">Shortlist It!</a>";
$booknow = "<a href='https://www.mydomainname.com.au/book.php?apart=".$extraField->value."' title='Book ".$this->item->title." for your Hamilton Island accommodation!'>Book Now</a>";
} elseif($extraField->name == "Property Tagline") {
$tagline = "<h3 class='tagline'>".$extraField->value."</h3>";
} elseif($extraField->name == "Main Image") {
$mainimage = $extraField->value;
} elseif($extraField->name == "Main Image Caption") {
$mainimagecaption = $extraField->value;
}
}
}
}
Step 2: Modify the core extra fields loop in my sub-template to skip those fields I want skipped as I'll use them elsewhere
<?php if($extraField->value && strpos($fieldexceptions, $extraField->name) < 1 ): ?>
Step 3: Do normal php stuff...
<div class="myTools">
<?php echo $enquire; ?>
</div>
<div class="myTools">
<?php echo $shortlist; ?>
</div>
<div class="myTools">
<?php echo $booknow; ?>
</div>
Net result: most of my extra fields loop out in the normal scheme of things, but I have simple php vars that I can use anywhere I please, without having to mess around indexing arrays or anything else that is probably over my head
Anyway - I hope this helps someone out there - its rare I get to give back, but it seems like my most recent efforts may acutally help someone here!