Could you please paste the actual renderWith calls you're using?
renderWith($ArrayOfTemplates) is using the template with the shortest file name instead of following the order of the array ..
renderWith($ArrayOfTemplates) is using the template with the shortest file name instead of following the order of the array when template files are not in the default folders (Not in Layout or Includes) Example: themes/MyTheme/templates/Section/ has a.ss HeaderSection.ss & HeaderSection2.ss , a.ss will always be used 1st if all 3 items are passed in to renderWith().
该提问来源于开源项目：silverstripe/silverstripeframework
 点赞
 写回答
 关注问题
 收藏
 复制链接分享
 邀请回答
5条回答

采纳
点赞 评论 复制链接分享

采纳
public function Render_Title($Template = null) { $renderWith = array(); if ($Template) { $renderWith[] = $Template; } $renderWith[] = $this>ClassName . "_Title"; $renderWith[] = "Gadget_Title"; $renderWith[] = 'Title'; return $this>renderWith($renderWith); }
'Title.ss" will always be used 1st. if I comment out "Title" the next shortest template name is used (Gadget_Title). Changing the order of the array has no effect .
点赞 评论 复制链接分享 
采纳
Looking at
TemplateManifest>getCandidateTemplate()
, I can't see how this would be related to the length of a template name... The code example doesn't match the template names you described in the ticket. Can you please add a folder listing of all custom templates in your codebase? (so mysite/ and themes/)点赞 评论 复制链接分享 
采纳
I took a screenshot of my file structure : http://tinypic.com/view.php?pic=2zzjjh5&s=5 (Templates) http://tinypic.com/r/9roosh/5 (Php Code)
I use a "_" underscore in my file/folder names, could SS be treating them as sub_themes & getting the priority of templates wrong ?
点赞 评论 复制链接分享 
采纳
You're nesting templates into two levels of subfolders, correct?
templates/ Gadgets/ Gadgets_Page/ MyTemplate.ss
I'm not sure that's supported. We should either document that it isn't, or fix it. Somebody keen to write a test in
TemplateManifestTest
?点赞 评论 复制链接分享
相关推荐
 回答 1 已采纳 Problem Description There are n points on the plane, Pi(xi, yi)(1 i). When you reach Pn, the rule is changed, from now on you can only visit the points those have the smaller xcoordinate value than the point you are in now, for example, you are at Pi now, then you can only visit Pj(j < i). And in the end you back to P1 and the tour is over. You should visit all points in this tour and you can visit every point only once. Input The input consists of multiple test cases. Each case begins with a line containing a positive integer n(2 <= n <= 200), means the number of points. Then following n lines each containing two positive integers Pi(xi, yi), indicating the coordinate of the ith point in the plane. Output For each test case, output one line containing the shortest path to visit all the points with the rule mentioned above.The answer should accurate up to 2 decimal places. Sample Input 3 1 1 2 3 3 1 Sample Output 6.47 Hint: The way 1  3  2  1 makes the shortest path.
 回答 1 已采纳 Description Luke Skywalker races through the forest on a speeder bike, trying to outrun a patrol of Imperial scouts on Endor. A small moon near a new Death Star, Endor is covered by dense foliage and a thick forest of ancient towering trees. The speeder bike , which Luke stole from an Imperial scout, is an antigravity vehicle capable of speeds of 200 miles an hour. How quickly can Luke reach Princess Leia in the Ewok village? The forest is a plane with T trees. Luke's position is specified by a pair of coordinates ( xluke , yluke ) within the plane. The Ewok village has coordinates ( xewok , yewok ). You are to find the shortest travel time from Luke's position to the Ewok village. Input The first line of input contains T, xluke , yluke xewok , yewok . T lines follow; each gives the coordinates and diameter of a tree: xtreei , ytreei , dtreei . T is an integer not exceeding 10; coordinates and diameters are real numbers in miles. Trees do not intersect or touch one another. Output Output is a single real number, to two decimal places, giving the minimum travel time in seconds. Sample Input 2 0.0 0.0 10.0 0.0 4.0 0.0 1.0 6.0 0.0 1.0 Sample Output 181.13
 回答 1 已采纳 Problem Description The shortest common superstring of 2 strings S1 and S2 is a string S with the minimum number of characters which contains both S1 and S2 as a sequence of consecutive characters. For instance, the shortest common superstring of “alba” and “bacau” is “albacau”. Given two strings composed of lowercase English characters, find the length of their shortest common superstring. Input The first line of input contains an integer number T, representing the number of test cases to follow. Each test case consists of 2 lines. The first of these lines contains the string S1 and the second line contains the string S2. Both of these strings contain at least 1 and at most 1.000.000 characters. Output For each of the T test cases, in the order given in the input, print one line containing the length of the shortest common superstring. Sample Input 2 alba bacau resita mures Sample Output 7 8
 回答 1 已采纳 Problem Description There are N cities in the country. Each city is represent by a matrix size of M*M. If city A, B and C satisfy that A*B = C, we say that there is a road from A to C with distance 1 (but that does not means there is a road from C to A). Now the king of the country wants to ask me some problems, in the format: Is there is a road from city X to Y? I have to answer the questions quickly, can you help me? Input Each test case contains a single integer N, M, indicating the number of cities in the country and the size of each city. The next following N blocks each block stands for a matrix size of M*M. Then a integer K means the number of questions the king will ask, the following K lines each contains two integers X, Y(1based).The input is terminated by a set starting with N = M = 0. All integers are in the range [0, 80]. Output For each test case, you should output one line for each question the king asked, if there is a road from city X to Y? Output the shortest distance from X to Y. If not, output "Sorry". Sample Input 3 2 1 1 2 2 1 1 1 1 2 2 4 4 1 1 3 3 2 1 1 2 2 1 1 1 1 2 2 4 3 1 1 3 0 0 Sample Output 1 Sorry
 回答 1 已采纳 Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsawwielding psychopaths, hippies, and other terrors on their quest to find the exit. One popular mazewalking strategy guarantees that the visitor will eventually find the exit. Simply choose either the right or left wall, and follow it. Of course, there's no guarantee which strategy (left or right) will be better, and the path taken is seldom the most efficient. (It also doesn't work on mazes with exits that are not on the edge; those types of mazes are not represented in this problem.) As the proprieter of a cornfield that is about to be converted into a maze, you'd like to have a computer program that can determine the left and righthand paths along with the shortest path so that you can figure out which layout has the best chance of confounding visitors. Input Input to this problem will begin with a line containing a single integer n indicating the number of mazes. Each maze will consist of one line with a width, w, and height, h (3 <= w, h <= 40), followed by h lines of w characters each that represent the maze layout. Walls are represented by hash marks ('#'), empty space by periods ('.'), the start by an 'S' and the exit by an 'E'. Exactly one 'S' and one 'E' will be present in the maze, and they will always be located along one of the maze edges and never in a corner. The maze will be fully enclosed by walls ('#'), with the only openings being the 'S' and 'E'. The 'S' and 'E' will also be separated by at least one wall ('#'). You may assume that the maze exit is always reachable from the start point. Output For each maze in the input, output on a single line the number of (not necessarily unique) squares that a person would visit (including the 'S' and 'E') for (in order) the left, right, and shortest paths, separated by a single space each. Movement from one square to another is only allowed in the horizontal or vertical direction; movement along the diagonals is not allowed. Sample Input 2 8 8 ######## #......# #.####.# #.####.# #.####.# #.####.# #...#..# #S#E#### 9 5 ######### #.#.#.#.# S.......E #.#.#.#.# ######### Sample Output 37 5 5 17 17 9
 回答 1 已采纳 Problem Description The graph diameter is the length of the "longest shortest path" between any two vertices of a graph. In other words, a graph's diameter is the longest path which must be traversed in order to travel from any vertex to another when paths which backtrack, detour, or loop are excluded from consideration. Given an undirected graph, your mission is to count the number of diameters of it. Input The input contains multiple test cases. For each test case, it contains n+1 lines. Line 1: two integers m, n (2<= m <= 100, 1 <= n <= 4000) indicating that there are m vertices and n edges in the city. Line 2~n+1: each contains three integers i, j, d (1 <= i, j <= m, 1 <= d <= 100), indicating that there is an edge of length d connecting vertex i and vertex j. Output Output the value of the diameter and the number of diameters in a single line, separated by a single space. Sample Input 4 5 1 2 1 2 3 1 3 4 1 1 4 1 1 3 2 Sample Output 2 5
 4年前回答 1 已采纳 Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait for 1 or more (up to 10) orders to be processed before he starts any deliveries. Needless to say, he would like to take the shortest route in delivering these goodies and returning to the pizzeria, even if it means passing the same location(s) or the pizzeria more than once on the way. He has commissioned you to write a program to help him. Input Input will consist of multiple test cases. The first line will contain a single integer n indicating the number of orders to deliver, where 1 ≤ n ≤ 10. After this will be n + 1 lines each containing n + 1 integers indicating the times to travel between the pizzeria (numbered 0) and the n locations (numbers 1 to n). The jth value on the ith line indicates the time to go directly from location i to location j without visiting any other locations along the way. Note that there may be quicker ways to go from i to j via other locations, due to different speed limits, traffic lights, etc. Also, the time values may not be symmetric, i.e., the time to go directly from location i to j may not be the same as the time to go directly from location j to i. An input value of n = 0 will terminate input. Output For each test case, you should output a single number indicating the minimum time to deliver all of the pizzas and return to the pizzeria. Sample Input 3 0 1 10 10 1 0 1 2 10 1 0 10 10 2 10 0 0 Sample Output 8
 回答 1 已采纳 O' mighty warrior, Thy mission is to slay the foul king of Erythea. Thou shall find him in his realm in the south. God bless you, King of Isladia. After reading the order, you know you have a long, dangerous way down to the south, to find the king of Erythea in his realm and kill him. The Erythea realm is a rectangular region, with a number of horrible strongholds in it. Impenetrable walls enclose the region, so the only way for you to enter the realm is to fly by your Pegasus (flying horse) and land in some point in the region. The hiding place of the king is known so you just need to find your way to that location. As the area is extensive and covered by different terrain types, you have to travel on the gridlike roads in the region. The problem is, there are many guards on the towers of strongholds who can see you, and once seen, you have no chance to see your family again! The closer you travel to the strongholds, the greater the chances to be seen by the guards. The problem is to find the safest way from the point your Pegasus lands to the point where the king is. More abstractly, you have an m X n grid with squares of the same size, denoting the realm and the roads in it. You can travel along the lines in the grid (roads), and at each intersection (road crossing) you may turn into another road. Assume each stronghold comprises a set of adjacent squares of the grid (Figure 1). As you cannot enter a stronghold, your path never intersects the interior of a stronghold, yet you can travel on a road which is on stronghold boundaries (Figure 2). Suppose you can land your Pegasus exactly on a road crossing (the source point  S in Figure 1) and the hiding place of the king is on another road crossing (the destination point  D in Figure 1). Neither of these points lie inside a stronghold but may be placed on a stronghold boundary (as D does in Figure 1). Each road crossing is assigned a risk level which depends on the shortest road distance from the crossing to a point of the grid which is on the boundary of a stronghold. For a road crossing with the shortest road distance d to a boundary of strongholds, the risk level equals to m + n  d (Figure 3). It is assumed that there is at least one stronghold in the region, so that the definition of risk level is welldefined. The problem is, given the region's map and the source and destination points, find the path from the source to the destination which lies on the grid lines, so that sum of the risk levels of the points on the path (including source and destination) be minimum. As stated before, the path cannot intersect the interior of a stronghold. ![](http://acm.zju.edu.cn/onlinejudge/showImage.do?name=0000%2F1430%2F1430.gif) Input The input file consists of several test cases. The first line of the file contains a single number M, which is the number of test cases in the file (1 <= M <= 10). The rest of the file consists of the data of the test cases. Each test case data begins with a line containing the number of rows and the number of columns in the grid, which are in the range 1 to 80. The second line of a test case contains two pairs of integers, which are y and x coordinates of the source point (where the Pegasus landed) and the y and x coordinates of the destination point (where you may find the king). The horizontal and vertical lines in the grid are indexed from left to right and top to bottom from 0, so the coordinates can be expressed using these indices. Following the first two lines, there are lines that describe the map of the region. Each line consists of a string of 0's and 1's, describing squares of the corresponding row. A 1 in the string tells you that the corresponding square in the grid belongs to a stronghold. The width of the region is the length of all strings, and its height in the number of strings. Output The output for each test case is the total risk of the minimum risk path from the landing point to the destination. Recall that the total risk of a path is sum of the risk levels of the points in the path (including source and destination). If no path exists between source and destination, the output should be 'no solution'. The output for each test case must be written on a separate line. Sample Input 2 8 6 1 5 7 1 000000 011000 001000 000110 000110 000010 111000 000000 5 5 4 0 1 5 10000 10000 11111 00011 00001 Sample Output 149 101
 overstack的博客 作者：Hawstein ... 声明：本文采用以下协议进行授权： 自由转载非商用非衍生保持署名Creative Commons BYNCND 3.0 ，转载请注明作者及出处。...《Cracking the coding interview》是一本被许多
 苍痕的博客 Cracking the coding interview问题与解答 March 14, 2013 作者：Hawstein 出处：http://hawstein.com/posts/ctcisolutionscontents.html 声明：本文采用以下协议进行授权： 自由转载非商用非衍生保持署名...
 holybin的博客 转自：Hawstein的Cracking the coding interview问题与解答
 2月前拿我格子衫来的博客 info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technicalwriting/#assignments type: reference ...
 Added TFlexFileFormat.StreamSupport property (default True), which difines, is it necessary to open file stream or give the file name only.  FIX: If the TCustomProp.Assign method calls when the ...
 4年前yy27590845的博客 Accelerated C++ Practical Programming by Example by Andrew Koenig and Barbara E. Moo AddisonWesley, 2000 ISBN 020170353X Pages 336 ...Table of Contents Contents Chapter 0 Get
 weixin_30882895的博客 Lua 5.2 参考手册 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes Copyright © 2011–2013 Lua.org, ... Freely available under the terms of theLua license. keyring (译) keyrings...
 4年前weixin_30823227的博客 BASH(1) General Commands Manual BASH(1) ...NAME bash  GNU BourneAgain SHell SYNOPSIS bash [options] [command_string  file] COPYRIGHT Bash is Copyright (C) 19892013 by the Free...
 心逝夜空的博客 : Override the name of the “.gn” file. Normally GN loads the ".gn"file from the source root for some basic configuration (see "gn help dotfile"). This flag allows you to use a different file...
 夏天下雨的博客 This is a traditional problem that can be solved using recursion. For each node, connect the double linked lists created from left and right child node to form a full list. /** * @param root...
 4年前回答 1 已采纳 问题描述 : Farmer John’s N cows (1 <= N <= 100,000) are lined up in a row.Each cow is labeled with a number in the range 1…K (1 <= K <=10,000) identifying her breed. For example, a line of 14 cows might have these breeds: 1 5 3 2 5 1 3 4 4 2 5 1 2 3 Farmer John’s acute mathematical mind notices all sorts of properties of number sequences like that above. For instance, he notices that the sequence 3 4 1 3 is a subsequence (not necessarily contiguous) of the sequence of breed IDs above. FJ is curious what is the length of the shortest possible sequence he can construct out of numbers in the range 1..K that is NOT a subsequence of the breed IDs of his cows. Help him solve this problem. 输入: * Line 1: Two integers, N and K * Lines 2..N+1: Each line contains a single integer that is the breed ID of a cow. Line 2 describes cow 1; line 3 describes cow 2; and so on. 输出: * Line 1: Two integers, N and K * Lines 2..N+1: Each line contains a single integer that is the breed ID of a cow. Line 2 describes cow 1; line 3 describes cow 2; and so on. 样例输入: 14 5 1 5 3 2 5 1 3 4 4 2 5 1 2 3 样例输出: 3
 weixin_34367257的博客 If neither is present (or both are zero) the code is compiled with those future statements that are in effect in the code that is calling compile. If the flags argument is given and dont_inherit ...