0

We are using T4MVC to generate for us links to our scripts and content. We've added a Script folders to some of our areas, and we want T4MVC to generate links for them as well.

We've tried to modify it to add it as an line to T4MVC.tt.settings.t4, but unfortunately with no success. The links for the Areas/Webcard/Scripts folder haven't been generated:

readonly string[] StaticFilesFolders = new string[] {
    "Scripts",
    "Content",
    "App_Sprites",
    "Areas/Webcard/Scripts"
};

How do I generate links for a new folder when I add a folder to each area?

Yannick Blondeau
  • 9,465
  • 8
  • 52
  • 74
Łukasz W.
  • 9,538
  • 5
  • 38
  • 63

1 Answers1

3

It doesn't look like StaticFilesFolders supports/recognizes the path delimiter. It does however process items recursively, so you may want to try just adding "Areas" to the StaticFilesFolders list instead of "Areas/Webcard/Scripts". This should allow you to then access the scripts like @Links.Areas.Webcard.Scripts.Script1_js.

ataddeini
  • 4,931
  • 26
  • 34
  • Hi.. thanks for this, but id do not work for us.. it will generate to much trash, f.e. links to vies etc... any other ideas? – Łukasz W. Jun 03 '11 at 14:16
  • @ŁukaszW.pl: Not sure what else you could try outside of modifying the T4 template itself to generate code that supports parsing the paths. That would probably what I'd try next. Either that or re-evaluating your project structure to work with the basic `StaticFilesFolders` processing. – ataddeini Jun 03 '11 at 16:23
  • If someone codes this up, I'll happily add it to the official template – David Ebbo Jun 03 '11 at 19:56
  • @David Ebbo: Sounds good David--I may do that this weekend if I get the chance. – ataddeini Jun 03 '11 at 20:21
  • Wow... guys, this is so cool :P Please let us know in this section when you'll done it ;) Thanks in advice ataddeini ;) – Łukasz W. Jun 04 '11 at 15:54