Developer forum

Forum » Rapido » Snippet not working

Snippet not working

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Not sure if this is Rapido-related. But here goes...

In a "Custom_Blocks.cshtml" for product detail I render snippet to be used as a product title like this:

@SnippetStart("ProductTitle")
@productTitle 
@SnippetEnd("ProductTitle")

Then in the Master.cshtml I want to render that snippet like this:

<title>@RenderSnippet("ProductTitle")</title>

But that renders to 

<title><!--@Snippet(ProductTitle)--></title>

and the Snippet-definition renders to:

<!--@SnippetStart(ProductTitle)-->
Defeater Handle Standard | Chapter 2
<!--@SnippetEnd(ProductTitle)-->

 

I cannot figure out why this suddenly wont work?

Regards / Aki

 

 

 

 


Replies

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Don't know why the snippet won't work. But a much easier way of course, to manipulate the title, is to set the Title in the Pageview. Duh..

Pageview.Meta.Title = productTitle;

/Aki

 

You must be logged in to post in the forum