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 @Fields.Metadata.publish_date.ToString(“dd/MM/yy hh:mm”)

Filter by
Sorted by
Tagged with
12
votes
1answer
436 views

Razor Mediator and Tridion 2013: Install Woes

I've got a fresh install of Tridion 2013 which works quite nicely. When I went to install the Razor Mediator, though, the wizard failed with the following message: There is a problem with this ...
11
votes
1answer
738 views

Razor Templating - Addbinary (resolve binary)

Is there a function to call to resolve path of a binary? Example: This works and resolves the media.ID as a path. <img src="@Fields.asset.media.ID" tridion:type="Multimedia" alt="test"/> But ...
11
votes
1answer
598 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. ...
10
votes
2answers
833 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?
10
votes
2answers
891 views

Accessing Embedded Schema fields via list of Component Links

I have a razor component template which is looping through a list of component links trying to read out fields that come from an embedded schema. The Embedded Schema contains fields like Title, Body, ...
10
votes
2answers
381 views

Iterate through ComponentModel List

I have a Razor Template where I need to order a list of component links by a particular field in descending order (Fields.Date). Normally when I want to loop through a list I would just do something ...
10
votes
1answer
398 views

Razor mediator requires admin user even when no imports are configured

We have installed the razor mediator, and are now testing to see if we can save a Razor template building block. When saving a TBB we got the following message: Attempting to create Session - ...
9
votes
4answers
559 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"...
9
votes
2answers
500 views

IFunctionSource functions for DWT in Razor?

We are working on Tridion 2011 SP1 and we always used DWT (Dreamweaver templates). We have a huge collection of usefull custom functions that we are using accross various dreaweaver templates. Due to ...
9
votes
2answers
204 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 ...
9
votes
1answer
457 views

Razor mediator integration with UI2012 - Best practices

We are using Razor Mediator 5.3 templating engine with Tridion 2011 SP1 edition and host an ASP .NET 4.0 application. Now, we are trying to integrate UI2012 with the application. I need some ...
8
votes
3answers
379 views

Publisher service not finding Razor Helper methods

We are using Tridion 2013 and the Razor mediator. We import Razor Helper Functions in the Tridion.ContentManager.Config file, like so: <add import="/webdav/xxx Design Master/Building Blocks/...
8
votes
2answers
301 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 ...
8
votes
2answers
588 views

Resolve a component link in a Razor TBB

Is there a way to resolve a component link based on a tcm without it beign between src="" or href="" ? I mean, I have the TCM and I need to put the link in between a because is a RSS Feed but I don'...
8
votes
1answer
167 views

Determining the version of Razor Mediator installed

I am setting up a new SDL Tridion environment and need to install the Razor Mediator (on both the Content Manager and Publisher servers). I want to make sure that the environment that I am setting up ...
8
votes
1answer
211 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 ...
8
votes
1answer
256 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: ...
7
votes
3answers
514 views

Editing Razor TBBs in Visual Studio

Using Visual Studio 2012 I am able to edit Razor TBBs by opening and saving them back via webdav. The problem is that if there is a Razor syntax error, it seems like they are saved OK, but actually ...
7
votes
1answer
113 views

Content Porter skips Razor TBBs when importing

I can export Razor TBBs just fine from my Tridion 2013 SP1 system (using Content Porter 2013 SP1), however whenever I import, it skips them - they are not counted in the successful or failed items in ...
7
votes
1answer
494 views

Link Resolving with Razor Mediator

I am pretty new with Razor Mediator and of course having some issues while testing my TBBs. I am writing a TBB that renders HTML for HTML5 videos like this. <h2>@Fields.title</h2> <...
7
votes
2answers
753 views

Make component link fields inline editable

I'm working on a Razor template to display a kind of samll FAQ section. Each item of this FAQ (composed by a question and an answer in rich text fields) is added to the FAQ list as a component link ...
6
votes
3answers
649 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" --> @@...
6
votes
1answer
299 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 ...
6
votes
2answers
203 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.
6
votes
2answers
290 views

How to use a C# keyword - ref as an identifier in Razor TBB

My XML name in Schema is ref which is a Text field in the Metadata. When I am trying to display this field as @Component.Metadata.ref it throws an error: identifier expected, ref is a keyword ...
6
votes
2answers
368 views

'string' does not contain a definition for 'Title' when using Razor mediator

I am finding it hard to identify an error that occurs when executing Razor template building blocks. The error message is as follows: Engine: Error in Engine.Transform 'string' does not contain a ...
6
votes
2answers
348 views

Experience Manager Update preview raises “Cannot perform runtime binding on null reference”

I am using the following code to site edit the component links(multi-allowed field). @foreach(var comp in Fields.leader_list) { <tcdl:ComponentField name="Fields.leader_list" index="@comp....
5
votes
2answers
667 views

Fetching Page Metadata Field values in CT TBB :Tridion 2011

I want to fetch some page metadata field values in my CT, Template Building Block (Razor Template). The Component Template type is dynamic with a REL output format. I want the metadata information ...
5
votes
2answers
596 views

Mixing JSON data and Razor in Tridion 2011 Razor Template

I'm creating a Razor Component Template in Tridion 2011. In this template I want the output to be in JSON format. Now how do I mix the two languages? JSON should be seen as HTML not as code. Example: ...
5
votes
2answers
264 views

Razor Page TBB causing sporadic failures during Publishing

I have constructed a Razor page TBB that uses a reference component on a page in order to render multiple component presentations. The reference component is used by some C# code to add a list of ...
5
votes
1answer
179 views

Razor Mediator - Get Last Modifed Date of Component?

Can I get to the last modified date of a component from a Razor template? Update: I found the answer: Component.TridionObject.RevisionDate
5
votes
2answers
112 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 ...
5
votes
1answer
147 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 ...
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 = @...
4
votes
2answers
67 views

Impact of Upgrading razor version 1.2 to 1.3

I just want to upgrade razor v1.2 to 1.3. when I run razor v1.3 setup on SDl Tridion2011 SP1, it does not provide upgrade option and through an error message that another version is already ...
4
votes
1answer
68 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">&...
4
votes
1answer
287 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....
4
votes
1answer
182 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....
4
votes
1answer
150 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 ...
4
votes
1answer
202 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' ...
4
votes
1answer
225 views

Sporadic issues with @RenderComponentField using Razor Mediator for Tridion 2013

We are experiencing sporadic issues with @RenderComponentField() in our Razor templates. It seems that sometimes it does not render the field, just an empty TCDL tag, even when there is content in the ...
3
votes
2answers
538 views

Get the Schema title of an Embedded Schema within a Razor template?

Edit following request for clarity: I wanted to know if it were possible to get the Schema of an embedded field directly using the razor mediator. As the answers below state, it isn't. Original ...
3
votes
2answers
753 views

Identifier Expected error--problem with Razor Syntax

Below is the block of code that I'm having a problem with. <ul class="description-tabs-menu--tabs-nav"> @foreach(var fields in Component.Fields.product_tabs){ <li> <a ...
3
votes
2answers
163 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?
3
votes
2answers
214 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 ...
3
votes
1answer
245 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
3
votes
2answers
130 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/...
3
votes
1answer
502 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 ...
3
votes
1answer
73 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). ...
3
votes
1answer
32 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 ...