Developer forum

Forum » Development » RE:
Marco Santos
Reply

Hello.

I am struggling to resolve an issue with a Razor template, and since I haven´t really worked with Razor I'm not sure whether I am missing something simple. Hopefully you will be able to spot something on the examples and let me know what I am doing wrong.

So, I have a custom module that sends tags relating to search results in a particular hierarchy and we have a razor template to show those results. In that page there are extras, but are being sent several times over, but only in the Razor template. In attach are two pages that we used as debbuging aids, one which uses the classical HTML/tag combination, and one that uses a Razor template (there are also two files that contain the output of each one). They have both been reduced to the minimum required to check just what is happening with the loops.

The classical way has the correct way the output should be. The Razor one is mostly right, but includes additional loop items in a few entries. I suspect that the Razor file is not quite right (i.e. although it looks to me like it is the equivalent of the classical one, a key piece is missing). Could someone have a look and let me know if they spot anything?

Thanks.

Marco


Replies

 
Nicolai Høeg Pedersen
Reply

Hm, hard to tell.

I think we need to see some code.

It seems though, that your EBK.AvailableExtra.Loop loop exists in 2 different contexts - in 3rd level (inside the EBK.Result.Match.Loop) and 4th level (inside the EBK.Tariff.Loop).

Try renaming one of them.

 
Marco Santos
Reply

Actually, one is in the plural and the other in the singular (AvailableExtra). I have fallen for that one too. :)

From what you can spot the two ways are identical then? The classical and the Razor? I´m not missing anything on that side of things?

Marco

 
Nicolai Høeg Pedersen
Reply

They seems right.

But, would like to see the code generating this.

BR Nicolai

 
Marco Santos
Reply

Hello.

In attach are the relevant functions for the hierarchy that we are looking at. Any help will be greatly appreciated.

Thanks.

Marco

 

You must be logged in to post in the forum