1. Laurent Collongues
  2. Bug report
  3. Monday, 05 June 2017
  4.  Subscribe via email
Hi,

I need to customize the list view. I've copied default_hotspot.php to the htlm template directory to override it. Fine.

But I need to render specific fields from the customs ones in some specific position. Can't just "throw them" one after each other as per the standard template/layout.

Thus I needed to catch individual values to produce something like :

<script type="text/template" id="hotspot-list-item">
<div class="hs-place-summary">
{{#if multimedia}}
<div class="hs-galleria"></div>
{{/if}}

<h3>{{ title }}</h3>

<div class="basulm-hs-type">
{{{cf-typeterrain}}}
</div>


<div class="hs-hotspots-overview-short">
{{{cutDescription}}}
</div>


where "typeterrain" is the slug of the custom field I need to render under the title on each view.

But this placeholder did not exist in the json stream.

So, I've hacked components/com_hotspots/helpers/hotspot.php around line 67 this way :

// Add the custom fields to the array
if ($customFieldsConfig)
{
$customFieldsRegistry = new JRegistry($hotspot->customfields);
$jsonHotspot['customfields'] = preg_replace("@[\\r|\\n|\\t]+@", '', $layout->render(
array(
'customfieldsItem' => $customFieldsRegistry->toArray(),
'customfieldsConfig' => $customFieldsConfig
)
)
);
//
// apchea : adding individual custom fields key/value pairs
//
foreach($customFieldsRegistry as $key=>$cf) {
// echo $key." --> ".$cf;
$k = "cf-" . $key;
$jsonHotspot[$k] = $cf;
}
//
// end apchea
//
}


Is this the right way ? Or does something else already exist ? Or clever way to do it ?

If not, would you consider include it in the next release ?

Thanks,

Laurent
Responses (5)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Veranstaltung im Frontend sichtbar obwohl nicht ve
Hallo, folgendes Problem stellt sich mir: Wenn ich eine Veranstaltung dupl...
4 Replies
Posted on Friday, 09 February 2024
Suche bei der Matukio - Fehler Ö Ä Ü..
Hallo, evtl. könnt ihr mir weiterhelfen. Bei mir funktioniert die suche bei ...
3 Replies
Posted on Wednesday, 15 May 2024
  • New
  • When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    4 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5
    _MATUKIO_NO_EVENTS appears in the frontend if no e
    Hello, there ist still the problem, that on the frontpage appears COM_MATUKIO...
    2 Replies
    Posted on Sunday, 12 May 2024
  • New
  • verschiedene URL's für Kursübersicht einer Kategor
    Hallo, ich habe eine Frage in Bezug auf SEO: ein externer Spezialist macht die...
    3 Replies
    Posted on Monday, 29 April 2024