I am quite new to Umbraco (but love it already). So far I managed to install blog4umbraco and changed/add my own templates and site structure.
I am quite familiar with XSLT and very proficient in .NET
Here is what I have been trying:
I want to be able to add a Silverlight application to my pages/blog posts using the TinyMCE or Windows Live Writer (which I have writen plugins for before so I am guessing I just need to add the correct macro code .
First stop: TinyMCE. I figured I needed a macro and an XSLT that turns some parameters into HTML. That went fine but TinyMCE or Umbraco somehow manages to incorrectly render the macro. When I browse to the page the source of the page shows the macro marker so it is not correctly evaluated.
In TinyMCE:
<div umb_macroalias="Silverlight" umb_width="400" umb_height="300" umb_xapfile="1140" ismacro="true" umbversionid="26a6877f-8c6d-4619-9864-b3a9ba1970d4" umbpageid="1139" onresizestart="return false;" title="This is rendered content from macro" class="umbMacroHolder">
I can see that you added some variable to your xslt. Did you also wire up some parameters for those? It looks like you are not getting them assigned to your macro.
Much better than the garbage I had before BUT there were no changes in what is being rendered in TinyMCE and the parameters are still behaving strangly: width and height are not rendered and the link to the media/xap file is extended with xap3623
What types are the macro parameters? It seems that the xapfile is a mediacurrent. That will actually pass you some xml, so take a look at the source of xapfile with copy-of to get an idea of the format.
Maybe also try this:
<xsl:templatematch="/">
<xsl:copy-of selec="." />
to get the base macro parameters. I may have spelled wrong
I noted that Height and Width were both missing entirely! So I took a wild guess and renamed them to SLWidth and SLHeight and suddenly they appear. I would think that this is a bug...
So now that the template is working next up TinyMCE:
In the editor it renders a correct (and even working Silverlight app) preview but when rendering the page in the browser it outputs (view source):
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in a Template and I need the Template because it contains all the blog features. If only I could put the second line in the XSLT...
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in a Template and I need the Template because it contains all the blog features. If only I could put the second line in the XSLT...
It should read:
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in an Template and I need the XSLT because it contains all the blog features. If only I could put the second line in the XSLT...
I think that should be just fine. Only thing is that if you have any .Net usercontrol macros in your bodyText, those will only render, but will not be able to register stuff like postback events and so on.
But if you don't need that, then you should be fine :-)
Embedding Silverlight
Hi,
I am quite new to Umbraco (but love it already). So far I managed to install blog4umbraco and changed/add my own templates and site structure.
I am quite familiar with XSLT and very proficient in .NET
Here is what I have been trying:
I want to be able to add a Silverlight application to my pages/blog posts using the TinyMCE or Windows Live Writer (which I have writen plugins for before so I am guessing I just need to add the correct macro code .
First stop: TinyMCE. I figured I needed a macro and an XSLT that turns some parameters into HTML. That went fine but TinyMCE or Umbraco somehow manages to incorrectly render the macro. When I browse to the page the source of the page shows the macro marker so it is not correctly evaluated.
In TinyMCE:
In the browser source:
I also replaced the XSLT by a .NET UserControl but the effect was the same.
Browsing the web I found some issues concerning TinyMCE and macros (with quotes some say and I do have them)
I see a couple of possible issues:
Here is my xslt:
I commented the hyperlink for the download of Silverlight out because it was causing errors and I haven't figured that out yet.
Any pointers?
I can see that you added some variable to your xslt. Did you also wire up some parameters for those? It looks like you are not getting them assigned to your macro.
Should be something like:
Though it does look like you have them inserted in the TinyMCE.
Have you tried putting the macro directly in a template, to see if you can get that working first?
With regards to the links, it is probably because you need to escape your & characters in the url:
Thanks for replying Morten! Indeed I forgot to excape the & Thanks!
Instead of adding
I added
I tried adding the macro to a template:
Currently the names and aliases of the parameters are exactly the same (including casing)
This renders:
Much better than the garbage I had before BUT there were no changes in what is being rendered in TinyMCE and the parameters are still behaving strangly: width and height are not rendered and the link to the media/xap file is extended with xap3623
Any clues? It seems we are getting there...
What types are the macro parameters? It seems that the xapfile is a mediacurrent. That will actually pass you some xml, so take a look at the source of xapfile with copy-of to get an idea of the format.
Maybe also try this:
<xsl:template match="/">
<xsl:copy-of selec="." />
to get the base macro parameters. I may have spelled wrong
Exellent advise, thanks!
I changed the select for the mediafile to:
This works perfectly.
Now the Height and Width... By rendering
I noted that Height and Width were both missing entirely! So I took a wild guess and renamed them to SLWidth and SLHeight and suddenly they appear. I would think that this is a bug...
So now that the template is working next up TinyMCE:
In the editor it renders a correct (and even working Silverlight app) preview but when rendering the page in the browser it outputs (view source):
Any hints?
By the way: I don't get why I am getting v3 style macro code (<?UMBRACO_MACRO ... ) instead of the v4 style.
It seems I am not alone in this
I'll give the in that thread presented solutions a go and I will report back here. Still, feel free to give any advise.
I have narrowed it down to Dan's post:
Replace
by
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in a Template and I need the Template because it contains all the blog features. If only I could put the second line in the XSLT...
I am stuck.
Fixed it! After reading the other thread again I changed the BlogListPosts.xslt
I replaced
by
Can someone confirm this step? I am not quite sure that this is the right way to fix this.
By the way: Now I have Silverlight all around! Next step: Windows Live Writer but that should be easy now ;-)
Two posts back reads:
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in a Template and I need the Template because it contains all the blog features. If only I could put the second line in the XSLT...
It should read:
However, the first line (the one to be replaced) is in an XSLT whereas the second one is in an Template and I need the XSLT because it contains all the blog features. If only I could put the second line in the XSLT...
I think that should be just fine. Only thing is that if you have any .Net usercontrol macros in your bodyText, those will only render, but will not be able to register stuff like postback events and so on.
But if you don't need that, then you should be fine :-)
is working on a reply...