That line was ripped out of the helloWorld macro that is used as an
example on the tiddlywiki.org site. I never changed out the word
"world". I would change that line to read:
var parm = params.length > 0 ? params[0] : "";
You could just as easily change it to:
var parm = params[0];
Now beyond that, I've used only Firefox 3.5.4 to test and didn't run
into an issue. Let me know if either of those corrections worked for
you. I am working on getting a testing tiddler up on tiddlyspot as it
had been suggested to me.
On Wed, Nov 4, 2009 at 8:09 AM, Måns <[email protected]> wrote:
>
> Hi David
>
> I'm trying to test your htmlify macro - but it gives me identifier
> errors....
> Is it the params[0] : "world"; which cause problems? Can I replace
> "world" with a relative value to get the right output?
>
> YS Måns mårtensson
>
> On 4 Nov., 12:43, David C <[email protected]> wrote:
>> Never saw your reply FND.
>>
>> I was not using a plugin for allowing a macro nested into an html form
>> and that was my big issue. Also my syntax was not xhtml compliant but
>> I don't think that would have helped much.
>>
>> So I wrote my solution as a new macro selectfromlist creating my
>> dropdownlist from items of a particular tag. I created another one
>> called htmlify that I use to wrap the rest of my input tags with. Here
>> they are:
>>
>> config.macros.selectfromlist = {
>> handler: function
>> (place,macroName,params,wikifier,paramString,tiddler) {
>> var prms = paramString.parseParams(null, null, true);
>> var name = getParam(prms, "name");
>> var list = getParam(prms, "tag");
>> var output;
>> var tiddlers = store.getTaggedTiddlers(list);
>> var nPlugins = tiddlers.length;
>> for(var i=0; i<nPlugins; i++) {
>> var p = getPluginInfo(tiddlers[i]);
>> output += "<option value=\""+p.title+"\">"+p.title+"</
>> option> ";
>> }
>> wikify("<html><select name="+name+"> "+output+" </select></
>> html>",place);
>> }
>>
>> };
>>
>> config.macros.htmlify = {
>> handler: function
>> (place,macroName,params,wikifier,paramString,tiddler) {
>> var parm = params.length > 0 ? params[0] : "world";
>> wikify("<html>"+parm+"</html>",place);
>> }
>>
>> };
>>
>> An example of using both in a tiddly:
>> |Faction: |<<htmlify '<input name=faction type=text />' >>|
>> |Morph: |<<selectfromlist name:morph tag:Morph>>|
>>
>> On Oct 30, 10:55 am, FND <[email protected]> wrote:
>>
>>
>>
>> > > My test tiddler look like this:
>> > > <html>
>> > > <select name=morph><<tiddler DropdownOptionList with: "Morph">></
>> > > select>
>> > > </html>
>>
>> > I assume you're using a plugin to allow nesting macro calls in raw HTML
>> > sections?
>>
>> > > Without the html tags the test tiddler looks fine but doesn't create a
>> > > dropdown list. With them it results in a blank box.
>>
>> > You probably wanna insert the HTML and SELECT tags once in addition to
>> > creating an OPTION element per item.
>> > IIRC, ForEachTiddler offers begin/end parameters for that purpose.
>>
>> > If not, a test case would help:
>> > http://tiddlywiki.org/wiki/Troubleshooting
>>
>> > -- F.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en
-~----------~----~----~----~------~----~------~--~---