View Issue Details

IDProjectCategoryView StatusLast Update
0003659Composrcorepublic2018-08-05 20:39
ReporterChris GrahamAssigned To 
Status non-assignedResolutionopen 
Product Version 
Fixed in Version 
Summary0003659: New symbol to read metadata based on CMA hooks
DescriptionImplement a new symbol that can read out metadata (e.g. title, or thumbnail URL) for any given content type and ID.

This allows catalogue templates to pull in more complex data about resources being referenced.

Make sure it doesn't crash if invalid parameters given, or if there's a failed lookup.

 - title (gets directly from content lookup function)
 - url (gets directly from content lookup function)
 - thumb (gets using thumb_field in CMA metadata)
 - description (?)
 - ... many others from CMA hook (category, views, submitter, author, add_time, ...)

Make sure all data is returned in string form, as needed by Tempcode.

Document the symbol.
Additional InformationA very basic implementation (not doing most of the above specification) as a proof of concept...

<?php /*

Copyright (c) ocProducts, 2004-2016

See text/EN/licence.txt for full licencing information.

  Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
  **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****


* @license Common Public Attribution License
* @copyright ocProducts Ltd
* @package core

* Hook class.
class Hook_symbol_CMA_LOOKUP
    * Run function for symbol hooks. Searches for tasks to perform.
    * @param array $param Symbol parameters
    * @return string Result
   public function run($param)
        $content_type = $param[0];
        $content_id = $param[1];
        $field = $param[2];


        list(, , $cma_info, $content_row) = content_get_details($content_type, $content_id);

        return $content_row[$cma_info[$field]];
TagsNo tags attached.
Attach Tags
Time estimation (hours)1
Sponsorship open0


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-08-04 23:37 Chris Graham New Issue