#silverstripe IRC Log

IRC log for 9 May 2016

All timestamps are in UTC.

1: [00:00:01] * ss-helper quit (Remote host closed the connection)
2: [00:00:14] * ss-helper has joined #silverstripe
3: [00:01:48] <Admonish> another thing, while we are on this topic. When I tried using a ->where cluase like so: DataObject::get(modelName)->where("`AuthorID` = \"".strval(Member::currentUserID()."\"") the code errored out. The problem is that the from uses double qoutes instead of backticks
4: [00:02:56] <Admonish> Not sure why that is. But when I took the outputted query (from the mysql error) and changed the FROM "modelName" to: FROM `modelName` the query ran just fine
5: [00:05:13] <micmania1> Admonish: double quotes are fine in the ORM - there’s some standard its adhering to. For some reason it doesn’t work in the console, but queries run fine.
6: [00:05:35] <micmania1> You should be careful about using where though. Its not safe (the data is passed in raw) so use filter whereever possilbe.
7: [00:05:46] <Admonish> understood
8: [00:05:59] <Admonish> Thanks for the explaination
9: [00:08:37] * sod has joined #silverstripe
10: [00:08:38] <ss-helper> sod: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
11: [00:09:11] * sod quit (Read error: Connection reset by peer)
12: [00:09:19] * techquila has joined #silverstripe
13: [00:17:55] * robbiea quit (Remote host closed the connection)
14: [00:22:22] * robbiea has joined #silverstripe
15: [00:26:36] * robbiea quit (Ping timeout: 246 seconds)
16: [00:28:14] * robbiea has joined #silverstripe
17: [00:31:51] * ss23 quit (Ping timeout: 246 seconds)
18: [00:32:37] * robbiea quit (Ping timeout: 252 seconds)
19: [00:33:50] * robbiea has joined #silverstripe
20: [00:38:10] * ss23 has joined #silverstripe
21: [00:38:24] * robbiea quit (Ping timeout: 260 seconds)
22: [00:39:28] * robbiea has joined #silverstripe
23: [00:41:47] * robbiea quit (Read error: Connection reset by peer)
24: [00:47:36] * robbiea has joined #silverstripe
25: [00:48:22] <robbiea> Hi all - I've got another question about page hierarchy. In the case of a Blog Post, it can't be a "root" page, but it looks like it can still be created underneath a standard Page rather than a Blog. Is there a way to restrict this so that the Blog Post can only be created under a Blog?
26: [00:51:23] <micmania1> robbiea: you need to set $allowed_children on Page to not include BlogPost.
27: [00:52:38] <robbiea> micmania1: OK, so if I have ten variants of Page, and fifty equivalents of BlogPost, do I need to blacklist each equivalent of BlogPost in that array of each variant of Page? Seems like a lot of duplication where a "whitelist" approach would be more slimline...
28: [00:53:17] <micmania1> robbiea: it is a whitelist.
29: [00:53:40] <micmania1> You need to add all the child page types that are ALLOWED.
30: [00:53:53] <micmania1> otherwise it allows all.
31: [00:54:15] <robbiea> Lovely
32: [00:54:43] <robbiea> So if I say that Page::allowed_children is array('MySubPage') then I should only be able to add MySubPage underneath a Page, but not underneath a Blog for example...?
33: [00:55:04] <micmania1> yep :)
34: [00:56:10] <robbiea> Look at that :) as per my question earlier about tree-like displays of page types when creating, I think I'll swap out the greying-out approach for a hide/show approach and that should do the trick.
35: [00:56:14] <robbiea> Thanks for your help micmania1
36: [00:56:31] <micmania1> np
37: [01:05:09] <spronk> god i need fibre
38: [01:05:12] <spronk> fucking ufb
39: [01:30:08] * Stomach quit (Quit: zzz)
40: [01:35:52] * Stomach has joined #silverstripe
41: [01:36:34] <robbiea> JavaScript question - can I extend an entwine'd core function with my own logic, for simplicity's example "alert('my extension ran!')" at the end of updateSelectionFilter() in CMSMain.AddForm.js ?
42: [01:36:47] <robbiea> or do I need to copy and override the whole file?
43: [01:39:51] * micmania1 quit (Quit: micmania1)
44: [01:39:51] * BrewNaked has joined #silverstripe
45: [01:40:13] * micmania1 has joined #silverstripe
46: [01:44:36] * BrewNaked quit (Ping timeout: 276 seconds)
47: [01:56:02] * micmania1 quit (Quit: micmania1)
48: [02:02:01] <robbiea> For now I'll override the whole file, I don't like the approach though!
49: [02:05:20] * micmania1 has joined #silverstripe
50: [02:09:57] <micmania1> robbiea: you can extend it. You just need to use a more specific selector and call super() (or this.super() - i forget).
51: [02:10:13] <robbiea> micmania1: hopefully that's enough for me to go on - thanks
52: [02:10:48] <micmania1> robbiea: https://github.com/silverstripe/silverstripe-blog/blob/master/js/cms.js#L106
53: [02:20:14] * robbiea quit (Remote host closed the connection)
54: [02:51:37] * Admonish quit (Quit: Going offline, see ya! (www.adiirc.com))
55: [03:16:16] <Stomach> solr is going to be the death of me I swear it
56: [03:21:16] * Admonish has joined #silverstripe
57: [03:28:41] * BrewNaked has joined #silverstripe
58: [03:33:37] * BrewNaked quit (Ping timeout: 260 seconds)
59: [03:48:52] * techquila quit (Remote host closed the connection)
60: [04:00:07] <ss-helper> SS4 build tooling now documented - https://groups.google.com/d/msg/silverstripe-dev/-lWznj3Wi6I/B1KPTnz5CAAJ
61: [04:24:04] * Stomach quit (Quit: zzz)
62: [04:25:28] * Stomach has joined #silverstripe
63: [05:17:39] * BrewNaked has joined #silverstripe
64: [05:22:29] * BrewNaked quit (Ping timeout: 260 seconds)
65: [05:43:46] * glenn-bautista quit (Quit: Leaving.)
66: [05:47:20] * adrexia quit (Quit: My Mac has gone to sleep. ZZZzzz…)
67: [05:47:42] * adrexia has joined #silverstripe
68: [05:51:22] * zlinux has joined #silverstripe
69: [06:06:01] * eightythree has joined #silverstripe
70: [06:18:08] <eightythree> Morning
71: [06:18:31] * micmania1 quit (Quit: micmania1)
72: [06:28:54] <eightythree> I'm trying to figure out how to get value from dataobject field (Title) while I'm in page controller. Basically I want to dynamically generate message subject on form submit taking Title of that dataobject and put it in setValue. I've tried ->setValue($this->data()->Items()->Title) where "Items" is referring to my dataobject but this isn't working. Anyone could help me with that?
73: [06:35:10] * Eliseth has joined #silverstripe
74: [06:35:30] * Admonish quit (Ping timeout: 246 seconds)
75: [06:39:20] * glenn-bautista has joined #silverstripe
76: [06:40:44] * glenn-bautista quit (Client Quit)
77: [06:45:09] * eightythree quit (Quit: Page closed)
78: [06:45:23] * eightythree has joined #silverstripe
79: [06:56:56] * spronk quit (Ping timeout: 240 seconds)
80: [06:58:14] * wmk has joined #silverstripe
81: [06:59:00] * arnhoe has joined #silverstripe
82: [07:06:27] * BrewNaked has joined #silverstripe
83: [07:11:12] * BrewNaked quit (Ping timeout: 260 seconds)
84: [07:32:44] * Stomach quit (Quit: zzz)
85: [07:47:12] * elgabbu quit (Ping timeout: 250 seconds)
86: [07:47:13] * elgabbu_ has joined #silverstripe
87: [07:54:59] * Teddy_ has joined #silverstripe
88: [07:58:36] * kinglozzer quit ()
89: [08:07:33] * GioVdK has joined #silverstripe
90: [08:13:49] * marvanni has joined #silverstripe
91: [08:20:17] * Agilix_ has joined #silverstripe
92: [08:20:55] * swaiba has joined #silverstripe
93: [08:34:37] * arnhoe quit (Ping timeout: 260 seconds)
94: [08:37:56] * arnhoe has joined #silverstripe
95: [08:41:25] * Audlex has joined #silverstripe
96: [08:41:38] <Audlex> can i do something like this? Sort being the important part
97: [08:41:44] <Audlex> $Image.CroppedImage(970,645).Sort(Sort).URL
98: [08:42:07] <Audlex> I tried this and it did not work, i am wondering if I must <% with $Image.Sort(Sort) %> first?
99: [08:42:16] <Audlex> or similar
100: [08:42:29] * DimiStripe has joined #silverstripe
101: [08:43:14] <marvanni> How would you want to Sort 1 image?
102: [08:43:21] <Audlex> I now realise my stupidity
103: [08:43:22] <Audlex> -_-
104: [08:43:23] <Audlex> sorry
105: [08:43:46] <Audlex> too eager to do some fixes after a long holiday
106: [08:43:56] * agent44 has joined #silverstripe
107: [08:50:59] * guci0 has joined #silverstripe
108: [08:51:00] <guci0> Morning!
109: [08:55:25] * BrewNaked has joined #silverstripe
110: [08:58:19] * twicenaps has left #silverstripe
111: [09:00:06] <eightythree> hi marvanni, could you help me with something? I'm trying to figure out how to get value from dataobject field (Title) while I'm in page controller. Basically I want to dynamically generate message subject on form submit taking Title of that dataobject and put it in setValue. I've tried ->setValue($this->data()->Items()->Title) where "Items" is referring to my dataobject but this isn't working.
112: [09:00:06] * BrewNaked quit (Ping timeout: 265 seconds)
113: [09:01:13] <marvanni> if you want to set a value of a form field, you can use $form->loadDataFrom([‘FieldName’ => $value])
114: [09:01:46] <marvanni> and ->Items()->Title looks like you try to get the Title of more then one Item ?
115: [09:03:04] <eightythree> Items is from has_many relation like 'Items' => 'Item' so I've thought that would do the job
116: [09:05:17] <wmk> eightythree, yes, but that's a has_many list
117: [09:05:28] <wmk> so get the item you want the title from and read it.
118: [09:05:37] <wmk> e.g. ->Items()->first()
119: [09:05:59] <wmk> but you have to check if you have items before you read the Title...
120: [09:08:01] <Audlex> can I check for Children and not Childred of Children together?
121: [09:08:06] <eightythree> Is there any documentation for that?
122: [09:08:53] <eightythree> Or it's just pure php and I should go there?
123: [09:09:15] <eightythree> I mean php docs etc.
124: [09:10:15] <wmk> eightythree, $title = $this->Items()->count() ? $this->Items()->first()->Title : "Foo";
125: [09:10:54] <wmk> http://php.net/ternary
126: [09:11:54] <marvanni> Are you really need the Title of the first item of Items? how is first defined?
127: [09:12:54] <wmk> the first in the list...
128: [09:13:00] <wmk> you need to grab ONE item of your list
129: [09:13:18] <eightythree> I need title from any Item ... depending on which Item is displaying atm
130: [09:13:28] <wmk> you can sort the list like you want, either by $default_sort in the Item's dataobject or you sort that ->Items() list
131: [09:13:47] <wmk> eightythree, get the current item, grab it's title
132: [09:14:01] <wmk> depends on your code.
133: [09:14:36] <eightythree> For example if the Title is "Something" I just want to grab it and pass it to email template as $title or whatever
134: [09:15:49] <eightythree> "get the current item, grab it's title" - right, I thought so but couldn't write it properly
135: [09:16:15] <wmk> ;)
136: [09:16:21] <wmk> !paste eightythree
137: [09:16:21] <ss-helper> eightythree: Please paste your code using something like http://kopy.io/ or http://www.sspaste.com/ or https://gist.github.com/ and then paste the link here.
138: [09:16:25] <eightythree> Thank you guys, I wish I had whole that knowledge :)
139: [09:16:48] <wmk> have to run, good luck... if you share some code maybe we can help a bit more.
140: [09:16:59] <eightythree> Ok, cheers wmk
141: [09:17:14] <wmk> as you have a current item displayed you already found a way to get it somehow.
142: [09:19:36] <eightythree> Indeed, I'll try your clues and if that doesn't help I'll paste my code then :)
143: [09:20:33] <Firesphere> Hello world!
144: [09:20:50] <Firesphere> I am now going to spam a link. I would like it a lot if you'd upvote it! https://digitalocean.uservoice.com/forums/136585-digitalocean/suggestions/13781952-add-an-image-with-opensource-php-framework-silvers
145: [09:23:14] <Firesphere> DO has WordPress (ugh), Drupal (ugh), Joomla (really?!), so a SilverStripe image needs to be available!
146: [09:24:03] * wmk quit (Ping timeout: 250 seconds)
147: [09:39:33] * kinglozzer has joined #silverstripe
148: [09:41:55] * SH__ has joined #silverstripe
149: [09:42:14] <SH__> I was wondering, has anyone ever tried showing two seperate gridfields on a report, in the reports section?
150: [09:42:35] <Firesphere> Yep, it's possible, just override the form field generation iirc
151: [09:42:55] <Firesphere> I have no access to the then-created code anymore, so I'm not entirely sure.
152: [09:43:34] <SH__> Interesting
153: [09:44:31] <SH__> I guess getReportField() generates the GridField, can't see any other places where form fields are output
154: [09:50:44] * swaiba quit (Remote host closed the connection)
155: [09:50:49] * zlinux quit (Ping timeout: 260 seconds)
156: [10:14:51] <DimiStripe> Hey guys,
157: [10:14:51] <DimiStripe> When doing $Image->delete() on Image obejct - will it remove the file and resized (generated) files as well in 3.3 ?
158: [10:44:22] * BrewNaked has joined #silverstripe
159: [10:44:46] * ss23 quit (Ping timeout: 252 seconds)
160: [10:49:15] * BrewNaked quit (Ping timeout: 276 seconds)
161: [10:50:45] * ss23 has joined #silverstripe
162: [10:58:46] <Firesphere> DimiStripe: yes
163: [11:01:33] <Firesphere> Hey ss23
164: [11:01:40] <Firesphere> You're not over-radiated yet?
165: [11:03:37] <ss23> not yet :D
166: [11:03:42] <ss23> gunna hve to figure out how to make it glow brighter
167: [11:03:45] <ss23> it's not super bright yet
168: [11:11:23] <Firesphere> Add more batteries?
169: [11:11:56] <Firesphere> Or a nuclear plant maybe?
170: [11:12:15] <Firesphere> Mister "independent security researcher" *chocking on laughter*
171: [11:12:43] <kinglozzer> ss23: When did you have it? I thought I read somewhere that they get brighter as the bruising goes away
172: [11:20:25] * DarjusIT has joined #silverstripe
173: [11:21:05] <DarjusIT> Hi all if I need to save xml code to silverstripe field that field type should be HTMLText?
174: [11:23:45] * ajmitch quit (Ping timeout: 276 seconds)
175: [11:26:30] <ss23> kinglozzer: Yeah. It's been a week so far, and I think it's gotten brighter, just not bright enough
176: [11:26:45] <ss23> Firesphere: Hey I figuredi t sounded better than "enemployed developer" :P
177: [11:42:13] * cloph quit (Remote host closed the connection)
178: [11:45:32] * cloph_away has joined #silverstripe
179: [11:45:41] * ajmitch has joined #silverstripe
180: [11:51:48] * cloph_away is now known as cloph
181: [12:21:39] <DimiStripe> OK, guys, who know how long it takes SS to Sync Assets with 1mil of file records (1,000,000) and ~950,000 files really on disk ?
182: [12:21:53] <DimiStripe> any ideas if this is worth waiting to complete ?
183: [12:22:20] * wmk has joined #silverstripe
184: [12:23:12] <DimiStripe> Firesphere: thanks, indeed it does :)
185: [12:23:34] <DimiStripe> DarjusIT: hi ;)
186: [12:25:10] <DarjusIT> DimiStripe: ahoj :)
187: [12:33:09] * BrewNaked has joined #silverstripe
188: [12:37:45] * BrewNaked quit (Ping timeout: 250 seconds)
189: [13:04:11] * wmk quit (Ping timeout: 250 seconds)
190: [13:12:38] * Agilix_ quit (Ping timeout: 250 seconds)
191: [13:13:30] * eightythree quit (Ping timeout: 250 seconds)
192: [13:24:40] * wmk has joined #silverstripe
193: [13:50:48] * wmk quit (Read error: Connection reset by peer)
194: [14:04:57] * muskie9 has joined #silverstripe
195: [14:22:00] * BrewNaked has joined #silverstripe
196: [14:26:50] * BrewNaked quit (Ping timeout: 265 seconds)
197: [14:28:30] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
198: [14:36:04] * ss23 quit (Ping timeout: 260 seconds)
199: [14:43:06] * ss23 has joined #silverstripe
200: [14:54:28] * SH__ quit (Ping timeout: 250 seconds)
201: [15:12:37] <DimiStripe> If someone would be searching for my previous answer about how long does it take to sync 1mil assets - 45minutes (with $syncLinkTracking disabled) , and 3GB of RAM for one PHP process :)
202: [15:14:05] * BrewNaked has joined #silverstripe
203: [15:20:35] * eightythree has joined #silverstripe
204: [15:23:19] * cmcramer has joined #silverstripe
205: [15:29:37] * arnhoe quit ()
206: [15:37:48] * eightythree quit (Ping timeout: 250 seconds)
207: [15:39:28] * marvanni quit (Quit: marvanni)
208: [16:09:57] * GioVdK quit (Remote host closed the connection)
209: [16:29:11] * kinglozzer quit ()
210: [16:33:11] * muskie9 has joined #silverstripe
211: [16:34:33] * Teddy_ quit (Ping timeout: 240 seconds)
212: [16:35:18] * BrewNaked quit ()
213: [16:38:19] * Eliseth quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
214: [17:04:36] * agent44 quit (Quit: zzz)
215: [17:04:37] * eightythree has joined #silverstripe
216: [17:05:41] * agent44 has joined #silverstripe
217: [17:05:51] * agent44 quit (Client Quit)
218: [17:13:48] <DimiStripe> Guys
219: [17:13:54] <DimiStripe> on deleting image
220: [17:13:56] <DimiStripe> getting
221: [17:13:59] <DimiStripe> Fatal error: Call to undefined method Filesystem::remove_folder_if_empty() in Image.php on line 953
222: [17:14:05] <DimiStripe> Image.hp (is from framework)
223: [17:14:10] <DimiStripe> how is this possible ?
224: [17:14:16] <DimiStripe> 3.2.1
225: [17:19:53] * Dedra has joined #silverstripe
226: [17:21:26] <Dedra> Hi, someone knows if there are some free silverstripe 2 templates?
227: [17:21:51] <muskie9> DimiStripe double check Filesystem is in framework/filesystem/
228: [17:22:24] <muskie9> the method being called should be in Filesystem.php but looks like it can't find it for some reason
229: [17:22:44] <muskie9> Dedra SS 2 as in 2.4.x?
230: [17:23:25] <Dedra> 2.4.x yes :)
231: [17:23:34] <Dedra> just not 3 :) newest 2 version.
232: [17:23:38] <Dedra> searching for a friend :)
233: [17:24:13] <Dedra> He's using ss2 but he wants another design. Nothing special just free :)
234: [17:24:37] <muskie9> there used to be a catalog for those but it's been discontinued as the 2.4.x version is no longer supported
235: [17:27:02] <muskie9> and with SS 4 being (I think) days away from alpha1 it's probably worth suggesting that they try to upgrade to at least 3.1.x as it's going to become even harder to find 2.4 support, and it's pretty hard already ;P
236: [17:29:46] <Dedra> yep searched that one :(
237: [17:36:50] <eightythree> Hi fellas, how to properly get value from Title field from DO and set it as a value in form? Here's my code http://www.sspaste.com/paste/show/5730c9b660777 I've tried this ->setValue($this->ProductItems()->first()->Title) and it's working but it gets title from the first and only first DO, when I'll add second one, still got title frome the first DO ... I hope this make sense
238: [17:37:33] * marvanni has joined #silverstripe
239: [17:37:34] <eightythree> Damn, ProductItems = Items
240: [17:40:17] <marvanni> you are doing it wrong
241: [17:40:29] <marvanni> use $form->loadDataFrom(some array or object);
242: [17:42:58] <eightythree> Oh, hi marvanni yea you did write that earlier $form->loadDataFrom([‘FieldName’ => $value])
243: [17:43:11] <marvanni> just make sure that the array keys or object properties match the form field names
244: [17:43:28] <eightythree> But how I pass 'name' to email template?
245: [17:43:34] <marvanni> yes, its not gona get simpler then that
246: [17:43:41] <marvanni> thats a whole other storie
247: [17:43:45] <eightythree> Oh lol
248: [17:43:47] <marvanni> ie = y
249: [17:45:00] <marvanni> $email->populateTemplate(['Member' => $member])
250: [17:45:07] <eightythree> I'm going to check that out, thanks
251: [17:45:11] <eightythree> :)
252: [17:45:16] <marvanni> <% with $Meber %> $FirstName etc
253: [17:45:19] <marvanni> goodlcuk
254: [17:45:23] <eightythree> Hmmm I see
255: [17:47:21] <marvanni> Dedram why not get something from themeforest and convert the html to silverstripe templates
256: [17:50:10] <DimiStripe> muskie9: Deleting IMage - updated all framework to 3.2.3 , works now... I guess there was a bug
257: [17:54:23] <Dedra> Hm, i never used 3 how different is it to 2 (as programmer)?
258: [17:54:39] <Dedra> not the gui for the customer. Never really looked into it.
259: [17:56:31] <muskie9> it's a bit different, a bit of a learning curve, but imo it's much much better than 2
260: [17:59:29] <Dedra> hm i just made the start tutorial for ss2 and that was enough for my minimal usage ^^
261: [17:59:36] <Dedra> is there a good tutorial like the ss2 one for 3 now?
262: [18:00:06] <muskie9> Dedra http://www.silverstripe.org/learn/lessons/
263: [18:00:55] <muskie9> if you're just starting out in SS I wouldn't even bother with SS 2
264: [18:01:45] <Dedra> i used ss2 for some projects. But just did the starting tutorial for it. and learned the rest myself.
265: [18:02:11] <Dedra> I'll check it out, ss3 :)
266: [18:02:21] <Dedra> There's no book like the ss2 one?
267: [18:02:36] <Dedra> i bought the ss2 book never looked into it :(
268: [18:03:10] <muskie9> no book, but the community docs/lessons I think are better
269: [18:04:10] <cmcramer> There arn lots of tutorials, etc at silverstripe.org. 3 is much better than 2, both for programmer and end users.
270: [18:05:34] * arnhoe has joined #silverstripe
271: [18:43:17] * vanny has joined #silverstripe
272: [18:43:36] <vanny> hi all
273: [18:44:55] <Dedra> Ok, tahnk you for your help :)
274: [18:45:04] <Dedra> I'll do the lessons this weekend to try my best :)
275: [18:45:08] * shellbackpacific quit (Read error: Connection reset by peer)
276: [18:45:19] * Dedra quit (Quit: Bye guys, have to go!)
277: [18:45:22] * shellbackpacific has joined #silverstripe
278: [18:47:07] <vanny> im using onAfterWrite to check a dataobject and make sure all credits/debits balance, but obviously it runs on every update, meaning it get stuck in a loop, any idea around this.
279: [18:48:46] * arnhoe quit (Remote host closed the connection)
280: [18:49:17] * arnhoe has joined #silverstripe
281: [18:49:18] <cmcramer> @vanny does this help http://www.silverstripe.org/community/forums/data-model-questions/show/6805
282: [18:51:14] <vanny> cool, that might work, was also going to change to an update query, as that wouldnt call write function
283: [18:51:24] <vanny> if I am understanding it correctly
284: [18:53:12] <cmcramer> @vanny that link example is for onBeforeWrite, but I've used a similar strategy in onAfterWrite
285: [18:55:23] <vanny> im testing it now, it makes total sense :)
286: [18:55:58] <vanny> it is not the first time through, ignore it
287: [19:04:37] <vanny> perfect thank cmcramer
288: [19:05:32] <cmcramer> @vanny :)
289: [19:07:17] * gelignite has joined #silverstripe
290: [19:14:06] * zlinux has joined #silverstripe
291: [19:33:58] * eightythree quit (Ping timeout: 250 seconds)
292: [19:50:13] * Stomach has joined #silverstripe
293: [19:54:41] * Phlunk3 has joined #silverstripe
294: [20:06:49] * arnhoe_ has joined #silverstripe
295: [20:06:55] * arnhoe quit (Read error: Connection reset by peer)
296: [20:09:11] * arnhoe_ quit (Read error: Connection reset by peer)
297: [20:09:34] * arnhoe has joined #silverstripe
298: [20:14:24] * arnhoe quit (Ping timeout: 260 seconds)
299: [20:19:46] * arnhoe has joined #silverstripe
300: [20:30:35] * DarjusIT quit (Ping timeout: 276 seconds)
301: [20:32:13] * arnhoe_ has joined #silverstripe
302: [20:35:06] * marvanni quit (Quit: marvanni)
303: [20:35:37] * arnhoe quit (Ping timeout: 260 seconds)
304: [20:37:40] * arnhoe_ quit (Ping timeout: 252 seconds)
305: [20:37:59] * arnhoe_ has joined #silverstripe
306: [20:42:19] * arnhoe has joined #silverstripe
307: [20:42:22] * arnhoe_ quit (Read error: Connection reset by peer)
308: [20:45:37] * arnhoe quit (Client Quit)
309: [20:56:43] * glenn-bautista has joined #silverstripe
310: [21:17:24] * zlinux quit (Ping timeout: 260 seconds)
311: [21:22:31] * gelignite quit (Quit: http://bit.ly/1kso8Ta)
312: [21:32:54] * micmania1 has joined #silverstripe
313: [21:34:14] * Azure|dc has joined #silverstripe
314: [21:34:54] * Azure quit (Ping timeout: 260 seconds)
315: [22:04:30] * cmcramer quit (Quit: Textual IRC Client: www.textualapp.com)
316: [22:06:44] * muskie9 quit (Quit: Textual IRC Client: www.textualapp.com)
317: [22:10:24] * guci0 quit (Ping timeout: 250 seconds)
318: [22:10:44] * micmania1 quit (Quit: micmania1)
319: [22:12:22] * micmania1 has joined #silverstripe
320: [22:14:49] * Stomach quit (Quit: zzz)
321: [22:15:16] * Exor_ has joined #silverstripe
322: [22:15:16] <ss-helper> Exor_: Welcome to #silverstripe! Please ask your questions but don't leave too soon, we are a busy lot.
323: [22:16:25] <Exor_> Hi, does anyone know how to specify a specific template to render from within a DataExtension?
324: [22:25:54] <micmania1> Exor_: what does your DataExtension extend?
325: [22:27:13] <Exor_> The Silverstripe Blog module Controller: Blog_Controller. Basically, I want to load different templates when the DataExtension has been applied.
326: [22:28:03] <micmania1> Exor_: do you have your own actions or do you want to change the main templates?
327: [22:28:47] <Exor_> micmania1: I just want to change the main templates.
328: [22:34:25] <micmania1> Exor_: is your DataExtension part of a module?
329: [22:35:31] <Exor_> micmania1: Yes.
330: [22:36:18] <micmania1> And where is the new template? Is that also part of the module?
331: [22:36:34] <Exor_> micmania1: Yes it is.
332: [22:37:34] <micmania1> Exor_: ok, I think you need to separate the two. For example, what if somebody wants to use a different template to what you’re providing? If you force that template to be used in code that becomes very hard.
333: [22:37:54] <micmania1> You can create a theme and have the template in the theme as an example.
334: [22:40:55] <Exor_> micmania1: What if that template just contains <% include SomeInclude %>? Can't those just be overwritten?
335: [22:41:43] <Exor_> Obviously there would need to be a disclaimer.
336: [22:42:46] <micmania1> You can but it still couples your controller to your view still.
337: [22:43:28] <micmania1> SilverStripe has subthemes. If you name the theme dir {existingTheme}_mysubtheme you can override templates like that.
338: [22:45:17] <Exor_> micmania1: The problem is, the templates in the sub-theme would still be applied irrespective of whether the DataExtension is enabled? I was hoping to use a set of templates conditionally.
339: [22:46:24] <micmania1> Exor_: the template should check for features rather than the controller deciding it should use a template.
340: [22:46:56] <micmania1> Exor_: You can use SSViewer::set_theme() in onBeforeInit/onAfterInit of your extension, but you should try not to
341: [23:11:03] * Stomach has joined #silverstripe
342: [23:16:02] <Exor_> micmania1: Okay, thanks. Is there no way to do something like "Use the template with this name" from a DataExtension? That way it can be overwritten from the themes folder?
343: [23:17:26] <Exor_> That way it shouldn't interfere with the blog module templates when the DataExtension is not enabled.
344: [23:24:11] <micmania1> Exor_: you can use config to check for modules/classes, but if you’re intending to release a module, just documenting how to do it in a template should be enough. In the real world most people don’t use built in templates because they don’t meet the criteria they need. They’re almost always going to implement their own theme anyway.
345: [23:33:06] * zlinux has joined #silverstripe
346: [23:59:36] * Azure|dc is now known as Azure

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