These are chat archives for locomotivecms/v3

15th
Apr 2016
Didier Lafforgue
@did
Apr 15 2016 14:44
hey @cappadona, are u around?
Nick Cappadona
@cappadona
Apr 15 2016 14:44
Hi @did
Didier Lafforgue
@did
Apr 15 2016 14:45
working on the bug right now
could you send me your 2 content types please?
Nick Cappadona
@cappadona
Apr 15 2016 14:45
cool…where you able to reproduce it?
Sure. What’s your preferred method?
Didier Lafforgue
@did
Apr 15 2016 14:45
did at locomotivecms dot com
Nick Cappadona
@cappadona
Apr 15 2016 14:47
incoming
thanks
Didier Lafforgue
@did
Apr 15 2016 14:47
thanks!
Didier Lafforgue
@did
Apr 15 2016 15:06
@cappadona
Nick Cappadona
@cappadona
Apr 15 2016 15:06
Hey @did
Didier Lafforgue
@did
Apr 15 2016 15:06
passing a slug to the with_scope for the belongs_to field doesn’t work in Engine
I don’t know if we need to allow it or not
Nick Cappadona
@cappadona
Apr 15 2016 15:07
okay…so with_scope won’t work for any of the relationship fields?
(in Engine at least)
Didier Lafforgue
@did
Apr 15 2016 15:07
it will
hold on
I’m testing something else
Nick Cappadona
@cappadona
Apr 15 2016 15:08
sure
Didier Lafforgue
@did
Apr 15 2016 15:08
alright, I’ve got a work-around
Nick Cappadona
@cappadona
Apr 15 2016 15:09
that was quick :)
Didier Lafforgue
@did
Apr 15 2016 15:09
a little bit verbose
<ul>
      {% with_scope _slug: 'floor-number-1' %}{% assign floor = contents.floors.first %}{% endwith_scope %}
      {% with_scope floor: floor %}
        {% for space in contents.spaces %}
          <li>{{ space.name }}</li>
        {% endfor %}
      {% endwith_scope %}
    </ul>
the with_scope tag expects an id (or the content entry itself)
Nick Cappadona
@cappadona
Apr 15 2016 15:10
Ah
so the collection is throwing it off
and don’t worry, that’s a lot less verbose than my workaround ;)
Didier Lafforgue
@did
Apr 15 2016 15:11
the strange thing is that it raised an exception on my engine
I’ve to leave, talk to you later
Nick Cappadona
@cappadona
Apr 15 2016 15:11
no worries…when you get a chance, I’m curious to understand why there’s a difference here btw Engine and Wagon
probably obvious, but I’m missing it
catch up with you later
and thanks again
Didier Lafforgue
@did
Apr 15 2016 20:28
I’m back @cappadona
the difference is that the _id of content entry in Wagon in its _slug
Nick Cappadona
@cappadona
Apr 15 2016 20:28
Hi @did
so in Wagon, _id = _slug
Didier Lafforgue
@did
Apr 15 2016 20:29
yes
Nick Cappadona
@cappadona
Apr 15 2016 20:29
and in Engine?
Didier Lafforgue
@did
Apr 15 2016 20:30
we should assign another kind of value to _id so that developers won’t think that _id == _slug
Nick Cappadona
@cappadona
Apr 15 2016 20:30
it’s namespaced due to multiple sites?
Didier Lafforgue
@did
Apr 15 2016 20:30
_id
bson id
Nick Cappadona
@cappadona
Apr 15 2016 20:30
ah…got it
thank you
Didier Lafforgue
@did
Apr 15 2016 20:30
you’re welcome!
Nick Cappadona
@cappadona
Apr 15 2016 20:30
that explains everything…appreciate it :)
Didier Lafforgue
@did
Apr 15 2016 20:30
:-)
Nick Cappadona
@cappadona
Apr 15 2016 20:30
Should I add this to the docs?
Didier Lafforgue
@did
Apr 15 2016 20:31
yeah! please!
thanks!
Nick Cappadona
@cappadona
Apr 15 2016 20:31
best on the with_scope tag or content_types pages?
both?
Didier Lafforgue
@did
Apr 15 2016 20:31
if we could also change the way to find a content_entry from its slug, I mean other than:
{% with_scope _slug: 'floor-number-1' %}{% assign floor = contents.floors.first %}{% endwith_scope %}
that’d be great as well
any suggestion?
content_types pages I’d say
Nick Cappadona
@cappadona
Apr 15 2016 20:32
thanks…will do
could we add a method to the contents drop that would take care of that?
actually I guess more likely to make that happen in the content_entry drop?
Didier Lafforgue
@did
Apr 15 2016 20:35
suggest a syntax :-)
Nick Cappadona
@cappadona
Apr 15 2016 20:38
hmm…are you thinking this would be used to reference any content_entry via any relationship?
Didier Lafforgue
@did
Apr 15 2016 20:39
no no, for now, just a simpler syntax to get a content entry by its _slug or _id
Nick Cappadona
@cappadona
Apr 15 2016 20:40
ah...
I’m coming up empty…you?
Didier Lafforgue
@did
Apr 15 2016 20:44
ah ah :-) I’ve got no idea yet ;-)