# |
May 25th 2017, 20:27 |
jeremyharris |
meder_ your Attachments table is in a plugin called Results, right? |
# |
May 25th 2017, 20:27 |
inoas |
but we cannot allow the "design agencies" that work with us to get access to the source code in any way... and we need revisions and translation, so we do it through the database |
# |
May 25th 2017, 20:26 |
inoas |
do you actually use TwigView to write twig template files instead of php ones within projects? cause it looked to me like that was its golden use case |
# |
May 25th 2017, 20:25 |
jeremyharris |
meder_ $attachments contains keys that your gist doesn’t even set |
# |
May 25th 2017, 20:25 |
inoas |
plugin_type_uuid_revision-uuid.twig |
# |
May 25th 2017, 20:25 |
inoas |
cause my twig files come from the database and look like FlexiCms_document_76ad7ef8_863b_456b_9490_c63d6ce0657a_76ad7ef8_863b_456b_9490_c63d6ce0657a.twig |
# |
May 25th 2017, 20:25 |
meder_ |
hm the id is blank yeah |
# |
May 25th 2017, 20:25 |
inoas |
I am not sure... I really would want to have twig template loading... like loading from a base template - but that won't be so easy |
# |
May 25th 2017, 20:24 |
WyriHaximus |
Yeah TwigView is designed to cover a lot more cases :) |
# |
May 25th 2017, 20:24 |
meder_ |
https://gist.github.com/anonymous/70f9f90f2830ecf9614cc4f2a3cf6f28 jeremyharris |
# |
May 25th 2017, 20:23 |
inoas |
I am just reusing the idea how to get helpers loaded <3 and the extensions :) |
# |
May 25th 2017, 20:23 |
inoas |
TwigView does a lot more |
# |
May 25th 2017, 20:23 |
inoas |
so I do not need to catch all kind of cases |
# |
May 25th 2017, 20:23 |
inoas |
well at least my stuff is tightly integrated |
# |
May 25th 2017, 20:22 |
WyriHaximus |
Aye, and if it doesn't, adept and release a new (major) verison |
# |
May 25th 2017, 20:21 |
inoas |
go the long run ;p? |
# |
May 25th 2017, 20:21 |
WyriHaximus |
inoas: awesome sounds great :D, only one way to find out how it works out in the long run ;) |
# |
May 25th 2017, 20:20 |
jeremyharris |
meder_ I think you are misusing $id there, as it is setting the id of the attachment. you should leave it empty so it is automatically associated with Results |
# |
May 25th 2017, 20:19 |
meder_ |
ok sec |
# |
May 25th 2017, 20:19 |
inoas |
but I am still unsure if the way I do things is good in the long run |
# |
May 25th 2017, 20:19 |
jeremyharris |
yes |
# |
May 25th 2017, 20:19 |
meder_ |
jeremyharris: $attachments is line 20, its not an entity its just a raw php array with the ids/fields |
# |
May 25th 2017, 20:19 |
inoas |
like say {{ Html.css('/assets/vendor/node_modules/marx-css/css/marx.min.css')|raw }} |
# |
May 25th 2017, 20:19 |
inoas |
and I could reuse all the nice extensions you build :) |
# |
May 25th 2017, 20:18 |
jeremyharris |
meder_ can you please gist $attachments at that point, as well as $patchedEntity |
# |
May 25th 2017, 20:18 |
inoas |
so all that's nice... |
# |
May 25th 2017, 20:18 |
inoas |
and the twig templates that reside in my database are already written as twig files, then again cached by twig loader |
# |
May 25th 2017, 20:18 |
meder_ |
eg $entity['attachments'] = array_merge ( $entity['attachments'], $attachments ); |
# |
May 25th 2017, 20:18 |
meder_ |
do I just need to "patch" $entity['attachments'] with line 25? |
# |
May 25th 2017, 20:18 |
inoas |
WyriHaximus: I can already use helpers, and extensions that you supply |
# |
May 25th 2017, 20:18 |
jeremyharris |
so that’s why using ‘associated’ showed no difference |
# |
May 25th 2017, 20:18 |
meder_ |
ok |
# |
May 25th 2017, 20:17 |
jeremyharris |
first level associations are patched by default |
# |
May 25th 2017, 20:17 |
meder_ |
i actually just found it's not using the associated table in the 'associated' call, weird |
# |
May 25th 2017, 20:17 |
meder_ |
jeremyharris: it has a ton of internal stuff, i pretty much replicated it there |
# |
May 25th 2017, 20:17 |
inoas |
and every element can have its own twig template |
# |
May 25th 2017, 20:16 |
meder_ |
https://gist.github.com/anonymous/36f6b41353aceaacbb7b01a653418ab0 |
# |
May 25th 2017, 20:16 |
inoas |
basically m document consist of multiple (translatable) elements, and each can be a module => small xml snipplet... which then fires a cakephp cell in the background |
# |
May 25th 2017, 20:15 |
inoas |
I will have something that maps to cells... |
# |
May 25th 2017, 20:15 |
inoas |
this is how I proceed now |
# |
May 25th 2017, 20:15 |
inoas |
https://gist.github.com/inoas/649a921179fbd160d80c4fc2bfd70876#gistcomment-2106583 |