Hey Matt, Sorry for the slow reply, been pretty busy with other things.
First the link you referenced to the 0.9 spec is really old. I would reference the most recent version which is 2.5.1 [1] [2]. As I browsed the spec I saw something interesting about Template Libraries which references using a <JavaScript> tag within the template [3]. You might want to look into that. With that said this could very well be a bug. [1] https://opensocial.atlassian.net/wiki/display/OSD/Specs [2] [2] http://opensocial.github.io/spec/2.5.1/OpenSocial-Templating.xml [3] http://opensocial.github.io/spec/2.5.1/OpenSocial-Templating.xml#TemplateLibraries On Thu, May 8, 2014 at 10:54 AM, Merrill, Matt <[email protected]> wrote: > Hi all, > > We’re upgrading our version of shindig from 2.0.0 to 2.5.0-beta5 and have hit > an issue with OpenSocial templates. > > We’re seeing a stray “</ostemplate>” tag get output in the rendered HTML from > a gadget which uses opensocial templates. The source snippet and output are > pasted below. You’ll notice the template has a <script> tag within it. The > script tag does some manipulation of the elements created by the template > itself with a library. > > Are script tags within OpenSocial templates not allowed? What is the > preferred alternative for this scenario if not? I’ve read most of the OSML > 0.9 spec and haven’t seen anything regarding it: > http://opensocial-resources.googlecode.com/svn/spec/0.9/OpenSocial-Markup-Language-Tags.xml > > As best I can tell from searching this list, this may be related to the > issues discussed in the following mail thread: > http://markmail.org/message/5azybf2efmvrsmdt > > Full disclosure: I’ve just been introduced to OpenSocial templates and am > inheriting this code for this upgrade, I’ve done some basic reading on > templates, so I know some but may be missing something fundamental. > > Many thanks! > -Matt > > Here is the template: > <script type="text/os-template" > xmlns:os="http://ns.opensocial.org/2008/markup" > xmlns:company_menu="http://info.company.org/smii/company_menu" > tag="company_menu:wrapper" > > <os:If condition="${My.data.status != '200'}"> > <div class="sectionWrapper errorMessage">Service is > unavailable at this time.</div> > </os:If> > <os:If condition="${My.data.status == '200'}"> > <div class="sectionWrapper" style="display: none"> > <div class="company_header"> > <div class="navigation"> > <a > href="javascript:ddtreemenu.flatten('treemenu_${My.name}', > 'expand')">Expand</a> > <span>|</span> > <a > href="javascript:ddtreemenu.flatten('treemenu_${My.name}', > 'contract')">Collapse</a> > </div> > <div class="title">${My.title}</div> > </div> > <ul id="treemenu_${My.name}" class="treeview"> > <os:Html code="${My.data.content}"/> > </ul> > <script type="text/javascript"> > ddtreemenu.createTree("treemenu_${My.name}", true); > </script> > </div> > </os:If> > </script> > > And here is the resulting HTML (cleansed), random ostamplate tag bolded: > <div class="sectionWrapper" style="display: none"> > <div class="company_header"> > <div class="navigation"> > <a > href="javascript:ddtreemenu.flatten('treemenu_about_company', > 'expand')">Expand</a> > <span>|</span> > <a > href="javascript:ddtreemenu.flatten('treemenu_about_company', > 'contract')">Collapse</a> > </div> > <div class="title">About</div> > </div> > <ul class="treeview" id="treemenu_about_company"> > <li><a href="javascript: void(0);">General Information</a> > <ul> > <li><a href="http://www.company.com/stuff1">Stuff 1</a></li> > <li><a href="http://www.company.com/stuff2">Stuff 2</a></li> > </ul> > </ul> > <script type="text/javascript"> > ddtreemenu.createTree("treemenu_about_company", true); > </ostemplate></script></div> >
