Of course,
here it is:

/*\
title: $:/plugins/vpl/jazzbokMem/db_macros_plan.js
type: application/javascript
module-type: macro


\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";


/*
Information about this macro

*/
exports.name = "db_macros_plan";

exports.params = [
    {name: "opt"}
];
/*
Run the macro
*/
exports.run = function(opt) {
    var str_return = "N/A";
    console.log("db_macros_plan 0.2. opt:"+opt);
       var dbPlanTiddler = this.wiki.getTiddler(opt);
    var audio_path = dbPlanTiddler.getFieldString("audio_ref");
    if (audio_path.includes("files/audio/cours")) {
        str_return = "audio src=\""+audio_path+"\" preload=\"auto\" 
controls></audio>";
        console.log(str_return);
    }
    return (str_return);
};

})();

Le lundi 5 décembre 2022 à 03:15:56 UTC+1, [email protected] a écrit :

> I think we are going to need to see the full definition of your 
> "db_macros_plan" macro.
>
> On Sunday, December 4, 2022 at 10:43:27 AM UTC-4 vpl wrote:
>
>> Hi,
>>
>> I've the following table that list different scores (tiddlers in 
>> tiddlywiki). See bottom of this mail
>>
>> This works perfectly except for the 
>> <$macrocall $name="db_macros_plan" opt={{{ [<currentTiddler>get[title]] 
>> }}} /> execution.
>>
>> This macro return what I expect, that is to say: 
>> audio src="files/audio/cours/blues-ex-1.mp3" preload="auto" 
>> controls></audio>
>> But in the rendered table this appears as a the string 'audio 
>> src="files/audio/cou ...." where I expect to get the refering html5 
>> audio element
>>
>> What is my error ..??
>>
>> Thanks a lot for your help
>> Regards
>>
>>
>> <table>
>> <tbody>
>> <tr>
>> <th>Mode</th><th>Audio</th><th>Comments</th><th>Score</th>
>> </tr>
>> <$list filter=<<plansDBFilter>>>
>> <tr>
>> <td><$view field="mode"/></td>
>> <td><$macrocall $name="db_macros_plan" opt={{{ 
>> [<currentTiddler>get[title]] }}} /></td>
>> <td><$view field="comments"/></td>
>> <td><img src= {{{ [<currentTiddler>get[score_ref]] }}} /></td>
>> </tr>
>> </$list></tbody></table>
>> \end
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e6ca4d01-4adf-473c-b06b-5de92c082194n%40googlegroups.com.

Reply via email to