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
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 = @...
10
votes
2answers
838 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
75 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
655 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
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">&...
10
votes
1answer
409 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 - ...
7
votes
1answer
114 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 ...
6
votes
2answers
294 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 ...
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 ...
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 ...
3
votes
2answers
818 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 ...
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 ...
8
votes
3answers
386 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/...
6
votes
2answers
350 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....
9
votes
1answer
459 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 ...
6
votes
2answers
389 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 ...
7
votes
3answers
518 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 ...
1
vote
1answer
352 views

Lifecycle of the Package

I have several page templates that use a single page template TBB. The page templates pass a string, version, into the package. The page template TBB evaluates this string via @TridionHelper.Package....
7
votes
2answers
754 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 ...
5
votes
1answer
180 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
3
votes
2answers
541 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 ...
11
votes
1answer
739 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 ...
5
votes
2answers
604 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: ...
12
votes
1answer
437 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 ...
5
votes
2answers
267 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 ...
9
votes
2answers
507 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 ...
7
votes
1answer
499 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> <...
10
votes
2answers
384 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 ...
8
votes
2answers
593 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
173 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 ...
10
votes
2answers
909 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, ...

1
2