tomostrand
Forum Replies Created
-
(Ignore previous post,
was not escaped)
Joe: I now have the custom template working correctly, and I also sort of discovered the reason for the earlier weird output display. There seem to be two independent problems which interact. Problem 1: Typing a space in the classic WordPress visual editor view inserts either a soft space OR an
hard space into the html text. It’s not clear to me how the editor determines which kind of space to insert (it seems to alternate inserting soft and hard spaces).
Problem 2: If a hard space is inserted directly in front of template=, the html text looks like this: template=
Now template
looks like a single word, and the short code parser doesn’t process it correctly. So the specified template is ignored and the default version of the event is displayed.I have no idea how to deal with the WordPress editor, but perhaps you could modify either your parser or lexical analyzer to recognize as a space, even if it’s directly adjacent to following text.
In any case, thanks very much for your replies, which led me to a satisfactory solution to my problem.Joe: I now have the custom template working correctly, and I also sort of discovered the reason for the earlier weird output display. There seem to be two independent problems which interact. Problem 1: Typing a space in the classic WordPress visual editor view inserts either a soft space OR an hard space into the html text. It’s not clear to me how the editor determines which kind of space to insert (it seems to alternate inserting soft and hard spaces).
Problem 2: If a hard space is inserted directly in front of template= “…”, the html text looks like this: template=”…” Now template looks like a single word, and the short code parser doesn’t process it correctly. So the specified template is ignored and the default version of the event is displayed.I have no idea how to deal with the WordPress editor, but perhaps you could modify either your parser or lexical analyzer to recognize as a space, even if it’s directly adjacent to following text.
In any case, thanks very much for your replies, which led me to a satisfactory solution to my problem.I’m clearly doing something wrong. I created a custom template with essentially the same code in my original question, leaving out the [my_calendar_upcoming, as well as the closing ]. Then I referenced the template, but the output is nothing like what the tags are specifying. In particular, it displays 6 events, not 4, and 3 of those are from past dates. Also, the information displayed is not what the template asks for: the Location is not shown, while the display includes the start and end times, which are not in the template.
I expected the template to work more or less like a macro, but the processor seems to be overriding the actual template code.
Excellent suggestion, thank you! I just need to know the proper syntax to reference a custom template in the shortcode. Also, do I use the template name, or the keyword that’s generated by the Template Editor?