Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...


How to use XMLPackages inside Topic pages

I would like to render an XMLPackage in a custom topic area on my site. There used to be a token for this like (!XmlPackage Name="packagename.xml.config" !).

We're using 9.3 and this simply renders as text. Does anyone know how to set this up?

Update: The below suggestions are correct, but I have another bit of information that may guide the conversation. I am trying to add this XmlPackage to a Topic that has been included into the template.master as a sidebar. Too much? Is this too deep?

A brand new topic page with t-topicname.aspx shows the XmlPackage. Adding it to a topic that is included in a template does not. Could it be the way I have the template including the topic?

asked Sep 26, 2013 in MultiStore by tyler (110 points)
edited Sep 27, 2013 by tyler

3 Answers

0 votes
try leaving off the xml.config

i'm looking at my 9.3 site.  it might be case sensitive.

But you have the correct syntax.
answered Sep 26, 2013 by Mikecali (1,525 points)
I've tried various cases and leaving off the xml.config and I still see the string rather than the results. Is there a setting to enable these in the AppConfig?
ok. dumb question, but i have to ask.

when you put it in the topic, do you click "html"?

if you just paste it there and then look at the html, you will see something like

<span style="color: #000000; font-family: verdana,geneva,arial,helvetica,sans-serif; font-size: 11px;">(!XmlPackage Name="packagename.xml.config" !)</span>
0 votes
That looks correct. Double check your topic for proper syntax. Also, make sure you enter the token in the HTML view, and not the Design view, of the Editor.
answered Sep 26, 2013 by Robert (3,440 points)
I have been using the HTML view for this, but it still confounds me.
Try creating a new topic, and manually typing the token in. Syntax is correct - tested and works on 9.3. If it still doesn't work for you, I would need to take a closer look to determine any potential issues.
What if I'm trying to include this into a topic that has been used in the template.master?
Yes, that should work as well. To rule out any variable, try viewing the topic on its own (t-topicname.aspx). Make sure that works first.

If calling the Xml Package directly from the template.master is an option, you can use:
<asp:Literal ID="ltXmlPackage" runat="server" Text='<%$ Tokens:XMLPACKAGE, packagename.xml.config %>' />
0 votes

I know this is a very old topic, but wanted to post my answer in case it solves someone else's problem. I was having this same issue and the solution was to allow the xmlpackage to be run by the engine in the package declaration.

<package version="2.1" displayname="Package Name" debug="false" includeentityhelper="true" allowengine="true">

You can double check if the package is actually allowed to run by the engine by accessing http://www.yoursite.com/x-packagenamewithoutxmlconfig.aspx. Please note that the url is for the package name only without the .xml.config extension. If the package is not allowed you will see an error message, otherwise the package content should show up.

After that the package should show in the topic without problems, I'm actually showing it in an entity page's description

I'm in version 9.5, not sure about backward compatibility.

answered Nov 1, 2016 by alerancur (180 points)