I have a page with a series of podcast episodes. I have transcripts for those episodes. I have made a link to retrieve and display the transcript while listening to it. I have made the link so it posts back to the same page and retrieves the transcript.
I can't get the transcript to display.
@{
var transId = 0;
var theTranscript = "";
if(!string.IsNullOrEmpty(Request.QueryString["transcript"])) {
Int32.TryParse(HttpContext.Current.Request.QueryString["transcript"].ToString(), out transId);
theTranscript = Umbraco.Content(transId).transcript;
<script type="text/javascript">
window.onload = function () {
$('#transcript').html(theTranscript);
};
</script>
}
}
The transcript is entered using a rich text editor. I've looked in the database and the text is there. If I set the transcript field using a plain string, it displays fine.
Thanks for your answer. Sadly, I've tried that and it doesn't work either.
If I replace the variable 'theTranscript' (either with or without the '@') with a static string, it works fine. For some reason, 'theTranscript' is not being set.
Should work if you got your name right Umbraco.Content(transId) returns DynamicPublishedContent. transId is the id from the node your want, check if Alias from the documenttype 'transcript', and get page like this url/view?transcript=1234
Using razor script to display an html field
I am using Umbraco 7
I have a page with a series of podcast episodes. I have transcripts for those episodes. I have made a link to retrieve and display the transcript while listening to it. I have made the link so it posts back to the same page and retrieves the transcript.
I can't get the transcript to display.
}
The transcript is entered using a rich text editor. I've looked in the database and the text is there. If I set the transcript field using a plain string, it displays fine.
I'd appreciate any help.
Jon
Think your javascript is not working, try
Thanks for your answer. Sadly, I've tried that and it doesn't work either.
If I replace the variable 'theTranscript' (either with or without the '@') with a static string, it works fine. For some reason, 'theTranscript' is not being set.
Should work if you got your name right Umbraco.Content(transId) returns DynamicPublishedContent. transId is the id from the node your want, check if Alias from the documenttype 'transcript', and get page like this url/view?transcript=1234
Thanks again for the help. I finally said 'to heck with it' and wrote a macro. Works fine now.
}
Thanks for sharing this with community!
is working on a reply...