Error compiling template "Designs/TTonline/ItemPublisher/List/LoopEvenimente.cshtml"
Line 107: Type 'CompiledRazorTemplates.Dynamic.ecbcabfffaea' already defines a member called 'GetImage' with the same parameter types
Line 117: Type 'CompiledRazorTemplates.Dynamic.ecbcabfffaea' already defines a member called 'GetImage' with the same parameter types
Line 134: Type 'CompiledRazorTemplates.Dynamic.ecbcabfffaea' already defines a member called 'GetImage' with the same parameter types
Line 156: Type 'CompiledRazorTemplates.Dynamic.ecbcabfffaea' already defines a member called 'GetImage' with the same parameter types

1 @{ 2 3 string areaLayoutPath = "/Files/Templates/Designs/TTonline/"; 4 areaLayoutPath = areaLayoutPath.Substring(0, areaLayoutPath.LastIndexOf("/")); 5 6 string Layout_Style = GetString("Item.Area.Layout_Style.Value"), 7 Template_Style = GetString("Item.Area.Template_Style.Value"), 8 Sticky_Header = GetString("Item.Area.Sticky_Header.Value"), 9 Template_Color = GetString("Item.Area.Template_Color.Value"), 10 bodyStyle = Layout_Style + " " + Template_Style + " " + Sticky_Header + " " + Template_Color; 11 12 } 13 @using Dna.ImageProcessor; 14 @using Dynamicweb.Frontend.Devices; 15 16 @{ 17 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 18 } 19 20 @functions{ 21 /// <summary> 22 /// Returns the URL for the given ImageSettings. 23 /// </summary> 24 /// <param name="settings">The ImageSettings used to generate the URL.</param> 25 private static string GetImage(ImageSettings settings) 26 { 27 return settings.ToUrl(); 28 } 29 30 /// <summary> 31 /// Returns the URL for the given ImageSettings. 32 /// </summary> 33 /// <param name="url">The URL to the image.</param> 34 /// <param name="settings">The ImageSettings used to generate the URL.</param> 35 public static string GetImage(string url, ImageSettings settings = null) 36 { 37 if (settings == null) 38 { 39 settings = new ImageSettings(); 40 } 41 settings.ImageUrl = url; 42 return GetImage(settings); 43 } 44 45 /// <summary> 46 /// Returns the URL for the given ImageSettings. 47 /// </summary> 48 /// <param name="url">The URL to the image.</param> 49 /// <param name="width">The requested width of the image.</param> 50 /// <param name="height">The requested height of the image.</param> 51 /// <param name="settings">The ImageSettings used to generate the URL.</param> 52 public static string GetImage(string url, int width, int height, ImageSettings settings = null) 53 { 54 if (settings == null) 55 { 56 settings = new ImageSettings(); 57 } 58 settings.Width = width; 59 settings.Height = height; 60 return GetImage(url, settings); 61 } 62 63 /// <summary> 64 /// Returns the URL for the given ImageSettings. 65 /// </summary> 66 /// <param name="url">The URL to the image.</param> 67 /// <param name="width">The requested width of the image.</param> 68 /// <param name="height">The requested height of the image.</param> 69 /// <param name="widthTablet">The requested width of the image for a tablet device.</param> 70 /// <param name="heightTablet">The requested height of the image for a tablet device.</param> 71 /// <param name="widthMobile">The requested width of the image for a mobile device.</param> 72 /// <param name="heightMobile">The requested height of the image for a mobile device.</param> 73 /// <param name="settings">The ImageSettings used to generate the URL.</param> 74 public static string GetImage(string url, int width, int height, int widthTablet, int heightTablet, int widthMobile, int heightMobile, ImageSettings settings = null) 75 { 76 var currentDevice = Dynamicweb.Frontend.PageView.Current().Device; 77 78 switch (currentDevice) 79 { 80 case DeviceType.Tablet: 81 width = widthTablet != 0 ? widthTablet : width; 82 height = heightTablet != 0 ? heightTablet : height; 83 break; 84 case DeviceType.Mobile: 85 width = widthMobile != 0 ? widthMobile : width; 86 height = heightMobile != 0 ? heightMobile : height; 87 break; 88 // default: Skip; just use existing width and height 89 } 90 if (settings == null) 91 { 92 settings = new ImageSettings(); 93 } 94 settings.ImageUrl = url; 95 settings.Width = width; 96 settings.Height = height; 97 return GetImage(settings); 98 } 99 } 100 101 <div class="col-md-12" id="lista_evenimente_custom"> 102 103 @{ 104 105 string areaLayoutPath = "/Files/Templates/Designs/TTonline/"; 106 areaLayoutPath = areaLayoutPath.Substring(0, areaLayoutPath.LastIndexOf("/")); 107 108 string Layout_Style = GetString("Item.Area.Layout_Style.Value"), 109 Template_Style = GetString("Item.Area.Template_Style.Value"), 110 Sticky_Header = GetString("Item.Area.Sticky_Header.Value"), 111 Template_Color = GetString("Item.Area.Template_Color.Value"), 112 bodyStyle = Layout_Style + " " + Template_Style + " " + Sticky_Header + " " + Template_Color; 113 114 } 115 @using Dna.ImageProcessor; 116 @using Dynamicweb.Frontend.Devices; 117 118 @{ 119 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 120 } 121 122 @functions{ 123 /// <summary> 124 /// Returns the URL for the given ImageSettings. 125 /// </summary> 126 /// <param name="settings">The ImageSettings used to generate the URL.</param> 127 private static string GetImage(ImageSettings settings) 128 { 129 return settings.ToUrl(); 130 } 131 132 /// <summary> 133 /// Returns the URL for the given ImageSettings. 134 /// </summary> 135 /// <param name="url">The URL to the image.</param> 136 /// <param name="settings">The ImageSettings used to generate the URL.</param> 137 public static string GetImage(string url, ImageSettings settings = null) 138 { 139 if (settings == null) 140 { 141 settings = new ImageSettings(); 142 } 143 settings.ImageUrl = url; 144 return GetImage(settings); 145 } 146 147 /// <summary> 148 /// Returns the URL for the given ImageSettings. 149 /// </summary> 150 /// <param name="url">The URL to the image.</param> 151 /// <param name="width">The requested width of the image.</param> 152 /// <param name="height">The requested height of the image.</param> 153 /// <param name="settings">The ImageSettings used to generate the URL.</param> 154 public static string GetImage(string url, int width, int height, ImageSettings settings = null) 155 { 156 if (settings == null) 157 { 158 settings = new ImageSettings(); 159 } 160 settings.Width = width; 161 settings.Height = height; 162 return GetImage(url, settings); 163 } 164 165 /// <summary> 166 /// Returns the URL for the given ImageSettings. 167 /// </summary> 168 /// <param name="url">The URL to the image.</param> 169 /// <param name="width">The requested width of the image.</param> 170 /// <param name="height">The requested height of the image.</param> 171 /// <param name="widthTablet">The requested width of the image for a tablet device.</param> 172 /// <param name="heightTablet">The requested height of the image for a tablet device.</param> 173 /// <param name="widthMobile">The requested width of the image for a mobile device.</param> 174 /// <param name="heightMobile">The requested height of the image for a mobile device.</param> 175 /// <param name="settings">The ImageSettings used to generate the URL.</param> 176 public static string GetImage(string url, int width, int height, int widthTablet, int heightTablet, int widthMobile, int heightMobile, ImageSettings settings = null) 177 { 178 var currentDevice = Dynamicweb.Frontend.PageView.Current().Device; 179 180 switch (currentDevice) 181 { 182 case DeviceType.Tablet: 183 width = widthTablet != 0 ? widthTablet : width; 184 height = heightTablet != 0 ? heightTablet : height; 185 break; 186 case DeviceType.Mobile: 187 width = widthMobile != 0 ? widthMobile : width; 188 height = heightMobile != 0 ? heightMobile : height; 189 break; 190 // default: Skip; just use existing width and height 191 } 192 if (settings == null) 193 { 194 settings = new ImageSettings(); 195 } 196 settings.ImageUrl = url; 197 settings.Width = width; 198 settings.Height = height; 199 return GetImage(settings); 200 } 201 } 202 203 204 205 @if(GetBoolean("ItemPublisher:Items.Any")){ 206 207 foreach(LoopItem item in GetLoop("ItemPublisher:Items.List")){ 208 209 int evenimentID = item.GetInteger("ItemPublisher:Global.PageId"); 210 string evenimentURL = item.GetString("ItemPublisher:Item.Url"); 211 string titlu = item.GetString("ItemPublisher:Item.Titlu.Value"); 212 213 string afisRaw = item.GetString("ItemPublisher:Item.Afis.Value"); 214 215 string afis = !string.IsNullOrEmpty(afisRaw) ? GetImage(afisRaw, 350, 230) + "&bgcolor=white" : "/Files/Images/NoImage/350x230.png"; 216 217 string locatie = item.GetString("ItemPublisher:Item.Locatie.Value"); 218 string oras = item.GetString("ItemPublisher:Item.Oras.Value"); 219 DateTime dataInceput = item.GetDate("ItemPublisher:Item.Data_Inceput.Value"); 220 DateTime dataFinal = item.GetDate("ItemPublisher:Item.Data_Final.Value"); 221 string descriere = item.GetString("ItemPublisher:Item.Descriere.Value"); 222 string perioada = item.GetString("ItemPublisher:Item.Perioada.Value"); 223 string linkTitle = item.GetString("ItemPublisher:Item.Link_Title.Value"); 224 225 226 227 228 <div class="col-md-6 col-sm-6 col-xs-12" id="test"> 229 <article class="news-block small-block articole-calendar"> 230 231 <a href="@evenimentURL" target="_blank" class="overlay-link image-overlay"> 232 <img src="@afis" alt="@linkTitle"/> 233 </a> 234 235 <header class="news-details"> 236 <h3 class="news-title"><a href="@evenimentURL" target="_blank">@titlu</a></h3> 237 <p class="simple-share"> 238 <span><i class="fa fa-clock-o"></i> @perioada </span> 239 240 </p> 241 </header> 242 243 </article><!-- News block --> <p> 244 </div> 245 246 } 247 } 248 249 250 </div> 251 252 253