Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4MVC support for static files in areas?

Tags:

t4mvc

I'm starting to make heavy use of T4MVCs "links" feature (eg, @Links.Content.Site_css). Does anyone know if there's a way to generate methods for files that are stored in folders within areas? I've tried making the following modification to the settings file, but haven't had any luck.

// Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js)
readonly string[] StaticFilesFolders = new string[] {
"Scripts",
"Content",
"Areas/Admin/Content"
};

Thanks very much in advance.

DS

like image 811
Damien Sawyer Avatar asked Feb 22 '23 15:02

Damien Sawyer


2 Answers

Instead of

"Areas/Admin/Content"

Try using:

@"Areas\Admin\Content"

I think this will do it.

like image 139
David Ebbo Avatar answered May 16 '23 06:05

David Ebbo


I didn't end up needing to alter T4MVC.TT at all. Adding "Areas" to the StaticFilesFolders in T4MVC.TT.settings.T4 did the trick.

// Folders containing static files for which links are generated (e.g.            Links.Scripts.Map_js)
readonly string[] StaticFilesFolders = new string[] {
"Scripts",
"Content",
"Areas"
};

Thanks for your help David. :-)

PS - using T4MVC Version 2.6.64

like image 21
Damien Sawyer Avatar answered May 16 '23 05:05

Damien Sawyer