2
votes

I am using the "?alttemplate=TemplateName" on the end of my url within my umbraco xslt code

Here is the example: <a href="{umbraco.library:NiceUrl(@id)}?alttemplate=CommunityVideo">Click here</a>

When a user clicks on the link a popup ( fancybox ) will trigger with the appropriate content rendering inside.

This pop up is working perfectly - the only issue is that the template associated to the node within umbraco has a RTE ( Rich Text Editor ). The content I input within the RTE is not displaying which is very weird because I have the umbraco field select item on the "CommunityVideo" template.

Theoretically the content should render but it's not.

Here is the code that populates the content:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title><umbraco:Item field="pageName" runat="server" /></title>
  <link rel="stylesheet" href="/css/main.css" type="text/css" />
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
</head>
<body id="popup">
  <div id="comm-video-wrap">
    <umbraco:Item field="bodyText" runat="server" />
  </div>
</body>

Any ideas?

2
can you show us the code where you populate the content for the RTE?Kieran
@Kieran See edits within original postFilth
do you have a bodyText property in your document type?Kieran
Anyone shed any light on this?Filth

2 Answers

1
votes

There are a bunch of unlikely reasons.

Firstly you've spelled the alias wrongly on the item - I'm guessing that the name on the doctype is "Body Text" or "BodyText" or "bodyText" - all of which would generate an alias of bodyText - if not that could be the problem.

Secondly is there a stylesheet setting hiding the rendered item - use firebug to check that out.

Using the alttemplate should work - but you need to be sure its running the template that you think it is.

It could be that the is no usable text in the RTE which you can verify by adding the textIfEmpty attribute.

<umbraco:item field="bodyText" textIfEmpty="There is no commentary text" runat="server" />

There are other umbraco:item attributes that might help with debugging, try adjusting your umbraco:item statement to:

<umbraco:item field="bodyText" insertTextBefore="**BEFORE**" insertTextAfter="**AFTER**" htmlEncode="true" textIfEmpty="There is no commentary text" runat="server"/>

and if you can't see any text then the template you think is being run simply isn't.

0
votes

Another possibility is that your Template name isn't exact (casing and all). Is fancybox doing an AJAX call to get the page? Is it getting the markup from above in the response or is it blank?