Skip to main content

Posts

Showing posts from April, 2014

Umbraco Drop Down from Datatypes and URL redirect

 @using System.Xml.XPath  @{  XPathNodeIterator preValueRootElementIterator3 = umbraco.library.GetPreValues(????);  preValueRootElementIterator3.MoveNext();  XPathNodeIterator preValueIterator3 = preValueRootElementIterator3.Current.SelectChildren("preValue", "");  <select name="forma" onchange="location = this.options[this.selectedIndex].value;" style="width:220px;background-color:#514e4b;color:#ffffff;box-shadow: 5px 5px 5px #888888;padding:3px;padding-bottom:5px;">  <option value="" style="font-size:1.6em">Playwrights by Category:</option>  @{  while (preValueIterator3.MoveNext())  {    @Html.Raw("<option value=\"my-web-page.aspx" + "?q=" + preValueIterator3.Current.Value + "\">" + preValueIterator3.Current.Value + "</option>");  }  }  </select>  }   You can then do something like this with the Qu

Umbraco Razor For Each Where Contains Order

  if  ( Model.NodeById ( 1066 ) . Children.Where ( "relatedTo == \"" +  @qFilter  +  "\"" ) . Any ( ) )          {              int  counter  =  Model.NodeById ( 1066 ) . Children.Skip ( 10  *  @thisPage ) . Take ( 10 ) . Where ( "relatedTo.Contains(\"" +  @qFilter  +  "\")" ) . Count ( ) ;          @Html.Raw ( "hello" ) ;                   foreach  ( var  thisItem  in  Model.NodeById ( 1066 ) . Children. Where ( "relatedTo.Contains(\"" +  @qFilter  +  "\")" ) . OrderBy ( "newsDate descending" ) . Skip ( 10  *  @thisPage ) . Take ( 10 ) )                   {                                       string  longDate  =  @thisItem.newsDate.ToString ( "dd/MM/yyyy" ) ;                    string  month  =  @thisItem.newsDate.ToString ( "MMM" ) ;                    string  day  =  @thisItem.newsDate.ToString ( "dd" ) ;                   < ul  class =