Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [razormediator]

The Razor mediator for Tridion is an alternative template engine. It provides the power of .net and the well documented Razor syntax. Using the syntax it's possible to access Component fields and template package items. Examples of use are: @Component.Fields.title, @Component.Image.alt_text or @...

2
votes
2answers
51 views

Which is better performance wise : Razor TBB or C# TBB?

I have around 50 lines of code in multiple page templates. I am not able move it to a component template as I need component and template ID from page and render some text from the components in ...
2
votes
2answers
83 views

XPM in SDL web 8.5 with Razor Mediator

In SDL Tridion 2013 SP1, we were using Razor Mediator built-in property/function "IsSiteEditEnabled" in our Razor functions. Based on its value if IsSiteEditEnabled is true or false we were adding the ...
2
votes
1answer
50 views

Is Razor Mediator compatible with Tridion Sites

We are planning to upgrade Tridion 2013 SP1 HR1 with Razor Mediator to Tridion Sites 8.5. Are there any breaking changes in 8.5 for Razor Mediator? Will Razor Mediator be supported in Tridion 9?
1
vote
3answers
113 views

How to consume XML sent by C# TBB in Razor template?

My C# TBB returns Keywords from a specific Category as XML: XmlDocument keywordsXml = new XmlDocument(); keywordsXml.LoadXml(cat.GetListKeywords().OuterXml); Item output = package....
1
vote
2answers
184 views

Anchor tag is not working inside the list

I have a Template to render the list class with anchor tag, it is working fine in Template Builder as well as in the preview mode in CMS. But in the browser after publishing the Page, I can able to ...
0
votes
1answer
114 views

Resolving URL of the Multimedia link (image) in Structure Group metadata using Razor Templating

I have Structure Group metadata Schema with image_cie field (Multimedia Link). I want to get the path of the image not the TCM URI. I tried with a following code <img src= "(@Page.StructureGroup....
1
vote
1answer
39 views

Imported RAZOR TBB in Workflow does not render

We are seeing an issue that when a template has a RAZOR TBB with an import: @importRazor("ContextLookupRCTBB.cshtml") Workflow can be started on the imported RAZOR TBB, but the in workflow version ...
3
votes
1answer
27 views

Checking non-nullable fields for values in Razor Mediator

I have a datetime value in a component's metadata that I need to access and write out in a component design using the Razor Mediator. Since this is a non-mandatory value I really need to check if it's ...
7
votes
1answer
290 views

Translating months in Razor

The Razor mediator allows for some formatting of datetime fields when they are rendered. For example, @Metadata.EventDate.ToString("MMMM") will render out the full text of the month. However, for ...
0
votes
1answer
38 views

Razor Mediator extra Text tags appearing in HTML

Using an if statement while templating using the Razor mediator: @if (...) { <text><div></text> } @if (...) { <text><div></text> } @if (...) { <text&...
3
votes
2answers
140 views

Razor Mediator for Web 8

Does Tridion Razor Mediator Supports SDL Web 8. I am able to download the installer from the below path,but its in beta version. https://drive.google.com/drive/folders/0B6hZ-cambftrV25ZLU5QTnJWSmM Can ...
2
votes
2answers
102 views

Embedded Razor Templates

are there any limitations with embedded razor templates. The issue: <span>Level0</span> @importRazor("/webdav/020-D%20Design%20Master/Building%20Blocks/System/Template%20Building%20Blocks/...
8
votes
1answer
184 views

Razor Mediator Helper Functions TBB Not Working with Experience Manager Preivew

We have a page region in XPM and it works fine with adding/removing components until you add the 6th+ component to it. After doing so the following error is produced: TemplateCompileException: ...
0
votes
4answers
110 views

DD4T with Razor Templating - feasibility

In regular DD4T Page properties and Component fields are exposed as ipage and icomponent. Field values are bound to HTML at run time. But my client claims why we need to construct HTML for every ...
6
votes
2answers
101 views

Razor Mediator Template Timeout on Save

After well over a year of good performance, suddenly I am unable to save almost all razor templates in our dev environment. Also publishing (rendering) of items which use razor templates is extremely ...
4
votes
1answer
176 views

Razor templating “Namespace name 'KeywordModel' could not be found”

I'm getting the following error when publishing a DCP using a Razor TBB that has references to the KeywordModel class. TemplateCompileException: CS0246: The type or namespace name 'KeywordModel' ...
9
votes
2answers
191 views

Using Tridion2012UI Experience Manager tags with Razor templates

I'm trying to use Dominic Cronin's Tridion2012UI functions as detailed at https://github.com/TridionPractice/tridion-practice/wiki/TridionUI2012FunctionsForUseInHtmlTemplates with Razor templates. I ...
4
votes
1answer
168 views

Access the field path of an item inside of a foreach loop using razor templating?

I am converting a DWT into a Razor template. In the Razor template I have a foreach loop. Inside of that foreach loop I am attempting to render a field of the current item using RenderComponentField....
11
votes
1answer
387 views

Adding line breaks in plain text when using Razor

I'm working on a Razor template to add plain text to an outbound email. I notice that if I just add the fields without any logic: @Fields.Title @Fields.Subtitle I am able to get line breaks. ...
5
votes
1answer
133 views

Using Razor Mediator for Outbound Email Templates

We are currently writing a number of Outbound Email templates. As all other templates are using the Razor Mediator, we are also using this for our templates for Outbound Email. One of the issues we ...
-4
votes
2answers
537 views

how get the current page URL in Razor Template and TOM .Net?

I want to get current page url in my razor code.how to retrieve that?
1
vote
1answer
477 views

How to retrieve component by specific Schema?

I have a schema id. based on that schema id i want to retrieve all components modified date (created by that schema). How to resolve it?
8
votes
4answers
525 views

How to include partial (unbalanced) html in a Razor Mediator if statement?

When saving a Razor Mediator Template it fails anytime that I have an if statement with unbalanced html tags in side of it. @if (Fields.subtitle != null) { <div class="subtitleColor"...
8
votes
2answers
259 views

How do you access the field of a parameter schema from a Razor Mediator Template?

The following is a simplified example: I have a Razor Mediator template and a parameter schema. The parameter schema "News Article Class" is attached to the Razor template and contains the mandatory ...
1
vote
2answers
85 views

Exception while trying to render “ComponentPresentationList” pushed as a package variable “MainSectionComponents”

I have pushed a package variable of type "ComponentPresentationList" with name "MainSectionComponents". I have written razor template code to render the componentpresentation list. @foreach (var ...
0
votes
1answer
101 views

Issue in converting DWT page template to Razor Template page template

I am trying to convert my DWT page template to Razor template. This Page template has following JSP Code. <%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %> <%@ ...
2
votes
1answer
94 views

How to get the Session in a Razor template

I would like to get the session in a Razor Template. I have tried TridionHelper.Session and also Session and _session with no luck. Any ideas?
2
votes
1answer
112 views

Loop thrugh StructureGroups with Razor MEdiator

I would like to get the Root Structure Group and then iterate through all immediate children of it using the Razor Mediator. Getting the root StructureGroup works, but it is a StructureGroupModel ...
0
votes
1answer
87 views

TemplateCompileException while working with array in razor [closed]

I'm having a difficult time getting the below code to work. It's choking on the testArray[Count] = "asdf" statement. How should this statement be written? <ul class="product-options--list"> @...
3
votes
1answer
81 views

Publishing a Razor Page Template fails with “config changed by another program”

I have Razor Mediator 4 Tridion 1.3.3.1 installed on Tridion 2013 SP1 with a single publisher. When I attempt to publish a page template, it fails in the publishing queue. The error message shown is,...
6
votes
2answers
182 views

unable to get template type with id:8 while publishing

I'm Using Razor Mediator and when I publishing i'm getting unable to get template type with id:8 while publishing.
3
votes
1answer
376 views

Why do we need to add NT AUTHORITY\SYSTEM to impersonation users?

A customer is experiencing a problem which seems to be related to the Razor Mediator. They have a template which makes use of a webdav connection in it. When they publish a page using the template ...
2
votes
1answer
266 views

Publish binaries in a package - more info

I have some doubts related to "Publish binaries in a package" default TBB referred in Default Finish Actions. Created the Component Template and added default finish actions TBB in my CT. CT Design ...
3
votes
1answer
146 views

Memory leak Issues with Razor Mediator 1.3.3

We started using Razor Mediator 1.3.3 for our template designs. We notice there is memory leak during the publishing. We have written some reusable custom function razor and using in our razor design. ...
8
votes
1answer
193 views

Razor Mediator and Tridion Media Connector

We are experiencing a very strange situation with Razor Mediator (v 1.3.3.0) development in Tridion 2011 SP1 with Media Manager Connector on Windows 2008 R2. The first time that you open a Razor TBB ...
4
votes
1answer
280 views

How can I check if a linked Component is first in the list?

I have the following syntax in a template using Razor Mediator: <tcdl:ComponentField name="Fields.contact_nav"> @foreach (dynamic link in Fields.contact_nav.links) { @if(link....
1
vote
2answers
102 views

Publishing Issue: Default Resolver not resolving from Page

When i publish page, Publishing queue shows success but nothing is delivered to file system. Its happening with all the pages which were working fine earlier. I do not have any event-handler, Custom ...
4
votes
1answer
135 views

Razor mediation function throwing invalid arguments error

Not sure if I'm missing something obvious here, thought I'd post the question before I stop working on it hoping that someone can shed some light on the issue. So I have the following in my razor ...
2
votes
0answers
73 views

Invalid procedure call or argument: Content Porter

I am getting following error while importing. I got same error few years back in 5.3 era, then adding IIS_WPG to temp folder resolved the issue, but now i am not getting any resolution of this. I ...
3
votes
1answer
124 views

Razor templating source code version

I installed Razor templating v1.3.3.1 in our system (Tridion 2013 SP1). This is the last version of Razor templating. I want to modify this version to add some log outputs. But in the source code of ...
3
votes
1answer
88 views

DCP inside DCP behaving like an Static CP (Razor Mediator)

We have a dynamic Component Presentation, inside which we are using a helper function. This helper function calls a RenderComponentPresentation("tcm:1-2", "tcm:1-4-32"). The Component Template tcm:1-...
3
votes
2answers
301 views

Displaying an image with Razor, itemId error or empty ID

I am new to Tridion so just playing with the quick guide right now. I have the page rendering but I cannot get my multimedia component to render. I have a component that has a link to a multimedia ...
1
vote
3answers
798 views

How to assign a Tridion Component Link to href using Razor

I have a Component that contains a field as Component Link. I would like to assign a hyperlink to that Component. What is the equivalent of <a tridion:href="TCMID">text</a> for a Razor ...
1
vote
2answers
264 views

How to fetch an Multi value Embedded Schema Image field using razor?

I would like to fetch an imagefield from the multivalue Embedded Schema Field. Here is my code. @foreach(var banners in Fields.Banners) { @if(banners.RDBannerSchema.WebBannerImage.ID !=null) &...
3
votes
1answer
239 views

How to template a Page Directive in Razor

I would like to assign the UTF-8 as My page encoding for Arabic Language using the below code <%@page pageEncoding="UTF-8" %> But I got error message
5
votes
2answers
3k views

Razor: how to use variables defined in page templates

I'm using Razor templates and I've defined a variable in the page templates. How can I used the variable in the component template using razor? In my Razor template I have: @{ string hotelTCM = @...
9
votes
2answers
705 views

Experience Manager and Razor templating

I have one simple question: We are using Razor templating in Tridion 2013 SP1. Is it including the Experience manager tags to the generated HTML? Or Do we need to add the EM tags manually?
3
votes
1answer
70 views

Razor template error

I'm working with razor templates, I have two if's inside a foreach. I've attached the simple code. But when I use Template Builder razor doesn't interpret the second if (it's like a text for Razor). ...
6
votes
3answers
552 views

Tridion Razor RenderComponentPresentation

have you ran into the problem when defining a template in a component query? When using DWT my call looked like this <!-- TemplateBeginRepeat name="allItemsInFolder" --> @@...
4
votes
1answer
64 views

razor used followed by a word

I'm using razor in Tridion 2013. I have this, and the number must be dynamic <span class="stars stars5"></span> I've tried: <span class="stars stars@Metadata.stars.Description">&...