#silverstripe IRC Log

IRC log for 5 December 2015

All timestamps are in UTC.

1: [00:04:56] * SH__ has joined #silverstripe
2: [00:07:33] <SH__> Hey guys, I cant seem to figure out how to populate data into a ListBoxField
3: [00:07:46] <SH__> I cant get the setValue() to work
4: [00:16:55] * SH__ quit (Ping timeout: 252 seconds)
5: [00:26:49] * MichaelHabib quit (Ping timeout: 245 seconds)
6: [01:00:59] * MichaelHabib has joined #silverstripe
7: [01:14:50] * Jordan_ has joined #silverstripe
8: [01:14:50] <ss-helper> Jordan_: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
9: [01:17:24] * Copperis quit (Remote host closed the connection)
10: [01:18:40] <Jordan_> Hi guys, I'm trying to do something that I'm not sure SilverStripe supports... I have two separate DataLists (the results of two separate CustomObject::get() calls) and after merging them into one list, I want to sort them by date. However the property that holds the date on CustomObjectOne is 'Posted' and the property on CustomObjectTwo is 'EndDate'.
11: [01:19:46] <Jordan_> If the property was the same on both I know I could do $merged_list->sort(array('Posted' => 'DESC'))
12: [01:20:16] <Jordan_> But I'm having trouble figuring out a way to sort them with the two different types of objects having different properties I want to sort by
13: [01:20:20] <Jordan_> Any suggestions?
14: [01:27:41] * saysora has joined #silverstripe
15: [01:56:07] * BrewNaked quit (Remote host closed the connection)
16: [02:05:16] * guci0 quit (Ping timeout: 252 seconds)
17: [03:08:30] * saysora quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18: [04:06:40] * saysora has joined #silverstripe
19: [05:08:40] * saysora quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20: [05:26:46] * zlinux has joined #silverstripe
21: [05:31:49] <Guest31243> Jordan_: Not out of the box that I can think of, but you could extend DataList and create a method called sortByCallback(), see DataList::filterByCallback() for an example
22: [06:04:45] * TRB143 quit (Ping timeout: 245 seconds)
23: [06:05:51] * TRB143 has joined #silverstripe
24: [06:06:00] * ss-log has joined #silverstripe
25: [06:19:06] * Liquide quit (Ping timeout: 260 seconds)
26: [06:23:25] * Liquide has joined #silverstripe
27: [06:29:17] * darjusIT2 has joined #silverstripe
28: [06:29:17] <ss-helper> darjusIT2: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
29: [06:59:08] * Error404NotFound has joined #silverstripe
30: [07:10:37] <MichaelHabib> Jordan_: hi, maybe you can create a method on one of these classes that returns a modified query ? if you can adjust the select statement to return "EndDate" as "Posted" then continue the merge as you're already doing?
31: [07:10:37] <MichaelHabib> http://api.silverstripe.org/3.1/class-DataQuery.html#_selectColumnsFromTable (just did a quick search & hope this can help)
32: [07:15:59] * MichaelHabib quit (Ping timeout: 245 seconds)
33: [07:45:16] * saysora has joined #silverstripe
34: [08:11:39] * UncleCheese has joined #silverstripe
35: [08:19:17] * zlinux_ has joined #silverstripe
36: [08:19:44] * zlinux quit (Ping timeout: 245 seconds)
37: [08:41:05] * Eliseth has joined #silverstripe
38: [08:41:05] * Eliseth quit (Client Quit)
39: [08:47:35] * gelignite has joined #silverstripe
40: [08:52:55] * Error404NotFound quit (Quit: User guilty of hitting the Big Red X...)
41: [09:20:41] * saysora quit (Quit: My Mac has gone to sleep. ZZZzzz…)
42: [10:20:23] * zlinux_ quit (Ping timeout: 260 seconds)
43: [10:36:05] * swaiba has joined #silverstripe
44: [10:44:33] * UncleCheese quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
45: [10:50:14] * Zauberfisch1 quit (Ping timeout: 260 seconds)
46: [10:50:57] * Zauberfisch1 has joined #silverstripe
47: [10:59:32] * Error404NotFound has joined #silverstripe
48: [11:29:38] * Error404NotFound quit (Ping timeout: 246 seconds)
49: [11:41:52] * Error404NotFound has joined #silverstripe
50: [11:42:01] * Error404NotFound quit (Remote host closed the connection)
51: [11:49:24] * Azure quit (Remote host closed the connection)
52: [12:43:46] * Azure has joined #silverstripe
53: [13:09:40] * MarkGuinn has joined #silverstripe
54: [13:46:31] * Jordan_ quit (Ping timeout: 252 seconds)
55: [14:01:49] * ss-log has joined #silverstripe
56: [14:02:59] <sam__> can anyone help plz this is sample code: http://www.sspaste.com/paste/show/5662ee8394b85
57: [14:04:45] <sam__> how can i loop over children and then apply class="row" to each 5th element and then apply
58: [14:06:49] <sam__> help plz
59: [14:47:16] <Zauberfisch> <% if $Pos == 5 %>class="row"
60: [14:54:16] <sam__> could you plz send me the link to that code updated
61: [14:54:32] <Zauberfisch> no
62: [14:55:19] <sam__> then where should i start loop
63: [14:58:01] * nontgor quit (Read error: Connection reset by peer)
64: [15:01:51] * sam__ quit (Ping timeout: 252 seconds)
65: [15:37:05] * LoveDuckie has joined #silverstripe
66: [15:38:24] * LoveDuckie quit (Client Quit)
67: [15:41:20] * MarkGuinn quit (Remote host closed the connection)
68: [16:00:13] * swaiba quit (Remote host closed the connection)
69: [16:11:46] <DimiStripe> Hey guys, if i have a /our-news/news/news-title link , is there a proper way to check if this link is Valid in my system? I mean i can check URLsegment , but it could be on another Parent (thus not News , but /reports/news-title ... So i need a proper check for the whole path
70: [16:15:40] <DimiStripe> Sphere: Thanks for yesterdays Set the forcje_js_to_bottom flag in your init. solution
71: [16:15:44] <DimiStripe> helped ;)
72: [16:16:04] <DimiStripe> Is there anything similar for CSS ?
73: [16:16:33] <DimiStripe> Cause now i have this last criticla issue: None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML. Optimize CSS Delivery of the following:
74: [16:19:26] * darjusIT2 quit (Ping timeout: 246 seconds)
75: [16:27:41] * MarkGuinn has joined #silverstripe
76: [16:35:04] * r_hector quit (Remote host closed the connection)
77: [16:47:58] * darjusIT2 has joined #silverstripe
78: [16:49:44] * gelignite quit (Ping timeout: 245 seconds)
79: [16:54:15] * darjusIT2 quit (Read error: Connection reset by peer)
80: [16:55:13] * MarkGuinn quit (Remote host closed the connection)
81: [17:23:54] * MarkGuinn has joined #silverstripe
82: [17:29:03] * gelignite has joined #silverstripe
83: [17:38:23] * MarkGuinn quit (Remote host closed the connection)
84: [17:55:09] * MarkGuinn has joined #silverstripe
85: [17:59:25] * MarkGuinn quit (Remote host closed the connection)
86: [18:16:07] <Zauberfisch> DimiStripe: yes, that's what routing does
87: [19:43:17] <DimiStripe> Zauberfisch: well, is there any fast way of checking if "/our-news/news/news-title" is valid ? smth like Director::somfunctiontocheckurl("/our-news/news/news-title"); which could return true or false ? (I'm now checking via get_one with filter on URLSegment
88: [20:06:03] * Azure quit (Excess Flood)
89: [20:14:20] <Zauberfisch> DimiStripe: I think it's done in handleRequest of Director
90: [20:14:23] <Zauberfisch> or Controller
91: [20:14:25] <Zauberfisch> not sure
92: [20:47:44] * NewGuy has joined #silverstripe
93: [20:49:10] <NewGuy> I've created an extension of RedirectorPage. I am able to create new fields and tabs. However, i cannot seem to remove any fields using $fields->removeByName(). I am trying to remove fields I've added in Page.
94: [20:49:39] <NewGuy> I am ofc using the updateCMSFields method
95: [20:52:05] <NewGuy> Is that normal behaviour, or am i doing it wrong?
96: [20:52:47] <Zauberfisch> updateCMSFields is called before RedirectorPage->getCMSFields()
97: [20:52:59] <Zauberfisch> so at the time you run your code, the fields are not in it yet
98: [20:53:24] <NewGuy> Oh. So what would be the proper way of excluding fields in Page from RedirectorPage?
99: [20:53:40] <Zauberfisch> I am not sure there is one
100: [20:53:50] <NewGuy> Hmm
101: [20:54:25] <NewGuy> i guess i could throw an if($this->ClassName == 'Page') my my Page.php's getCMSFields ?
102: [20:54:45] <Zauberfisch> yeah
103: [20:54:50] <Zauberfisch> that would work
104: [20:56:16] <NewGuy> hmm. Is it not possible to use getCMSFields(){ parent::getCMSFields } inside the extension instead of updateCMSFields?
105: [20:56:31] <Zauberfisch> no
106: [20:56:38] <Zauberfisch> either way, even if it worked
107: [20:56:59] <Zauberfisch> it would still be called before RedirectorPage
108: [20:57:32] <NewGuy> Yeah i guess i would have to go with the if block in Page.php. Thx :-)!
109: [21:15:24] * DimiStripe quit (Quit: DimiStripe)
110: [21:25:22] * Kolin_ is now known as Kolin
111: [21:34:23] * Azure has joined #silverstripe
112: [22:04:35] * MichaelHabib has joined #silverstripe
113: [22:12:17] * MichaelHabib quit (Remote host closed the connection)
114: [22:15:55] * ss-log has joined #silverstripe
115: [22:23:30] * NewGuy quit (Ping timeout: 252 seconds)
116: [22:33:56] <Sphere> 16/12/2015-21:30:00 The Force Awakens
117: [22:51:25] * MichaelHabib has joined #silverstripe
118: [23:49:57] * MichaelHabib1 has joined #silverstripe
119: [23:51:26] * MichaelHabib quit (Ping timeout: 260 seconds)
120: [23:51:27] * MichaelHabib1 is now known as MichaelHabib

These logs were automatically created by ss-log on irc.freenode.net.