Fork me on GitHub

Clip Relations  Bottom

  • Mateo, could you give us a brief run down on how relations work?
    All I'm getting is errors.
  • Ok
    I've just pushed a fix because I saw that after the creation of the relation, the form didn't redirect where it was supposed to. Anyways, I've implemented a parameter to update the tables in the next pageload.

    Try it again,
    when you setup a relation the table needs to be "refreshed", but that cannot be done in the same pageload because the class is already defined, so, in the next pageload the Doctrine Model is updated considering the new relation, and Clip needs to order the table update too, but that last step didn't happen.

    Try now icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Side note:
    I can't avoid to speak like a geek with you Darryl.
    I (really) like your sarcarms and off course, your feedback,
    so, let's take my techy words as a friendly sarcasm too icon_razz

    Syntesis:
    The DB table updates weren't updated after the creation
    I guess it's solved now icon_wink icon_razz

    --
    - Mateo T. -
    Mis principios... son mis fines
  • If you have a minute, can you give a quick run though on creating a relation between two publication types? There was a few things that I didn't quite grok.
  • Ok, I'm back after 18 hours without energy ups
    nothing to do with epic storms...


    So, in the relations form I've tried to use the semantical sense of the relation,
    because that helps to define the side where the relation field is added too.

    Let's suppose that we have a couple of pubtypes: Events and Photos.
    We want to relate them to use one Photo on an Event.
    Events Photos

    Then, we have two choices:
    If we want that each Photo be used only ONCE, we need a one-to-one relation. If we want to reuse Photos between Events we need a many-to-one (this one allows many Events per Photo).

    So, you setup the relation as:
    One Event has One Photo (one-to-one) or
    Many Event has One Photo.
    Being Events the owning side.
    The next step is simply assign the alias you want to use for the pubfield:
    Event.photo and Photo.event(s) for instance.
    So, Alias1 is "photo"
    and Alias2 "event", or "events" if it's many-to-one.

    You will see the use of the alias in the display template, as $pubdata.photo i.e.
    Note that all is embedded now in the $pubdata array, no more sparced vars on the display template.

    Later I'll add some config options for the relations.
    I hope to be clear, additional doubts and feedback are welcome icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Color me confused. I setup an Event pubtype, then a Photo pubtype. Then I setup the relation with one Event to many Photo; I set Alias 1 to "photos" and Alias 2 to "event". Then I created an event publication without setting anything in the photos relation field in the form. Then I create a photo pubtype and set the relation field to the title of event publication I created previously. I saved the form, but the relation setting did not stick and I haven't a clue if I even did it right.

    --
    Harness Technology
  • Uhm
    seems that the new Ajax Workflow broke the autocompleter, I have issues too, and I'm syncing the code to the recent changes in the core. Hope to get it fixed ASAP icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Ok
    I got it, please get the latest GIT code to be able to work with the latest Core's code.

    --
    - Mateo T. -
    Mis principios... son mis fines

This list is based on users active over the last 60 minutes.