I have just one little question, how do you best get use of GetMedia with Razor? I've created a Razor-macro that takes a page property "imageFolder" and pass it to GetMedia to be able to loop out some items.
With xslt it's pretty easy and straight forward. Compared to Razor I rather use Xslt instead when it comes to using GetMedia from the umbraco.library.
Is there some way than this, that doesn't make use of so much xpath. :)
@* get our values *@ var filePath = files.Current.Value; var fileName = files.Current.Evaluate("string(../@nodeName)"); var fileBytes = decimal.Parse(files.Current.Evaluate("string(../umbracoBytes div 1024)").ToString().Replace(".",",")); var fileExtension = files.Current.Evaluate("string(../umbracoExtension)"); var fileDescription = files.Current.Evaluate("string(../fileDescription)");
Razor and GetMedia by folders id.
I have just one little question, how do you best get use of GetMedia with Razor? I've created a Razor-macro that takes a page property "imageFolder" and pass it to GetMedia to be able to loop out some items.
With xslt it's pretty easy and straight forward. Compared to Razor I rather use Xslt instead when it comes to using GetMedia from the umbraco.library.
Is there some way than this, that doesn't make use of so much xpath. :)
Hi Fredrik!
Short : did you look at uQuery - which has a set of nice helper functions for both content ant media?
Regards
Jonas
How do I check if 'files' actually contains any images before I start my <ul> ?
Now if I select an empty folder I would get <ul></ul> which isn't valid markup.
is working on a reply...