# Working as a team on a Kirby website

**URL:** <https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476>\
**Category:** Questions\
**Tags:** v2\
**Created:** [September 11, 2017, 3:10pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476 "2017-09-11T15:10:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 11, 2017, 3:10pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/1 "2017-09-11T15:10:28Z")

</div>

Hello,

i try to fiddling out a idea how to work as a team of writers and developers on a kirby website.  
there should be a kind of staging server between the live site and the dev site.  
But there are also changes on the live site… e.g. comments and ratings.

Does anyone have a idea how to fullfill this task?

Here is a nice article… bit nothing of that will help me, IMHO.

> **[How not to break the Guardian website | Developer blog](https://amp.theguardian.com/info/developer-blog/2017/sep/04/how-not-to-break-the-guardian-website)**
>
> A developer explains how we make sure readers do not experience errors while we make changes to the website codebase

best regards,  
Svnt

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [September 11, 2017, 3:47pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/2 "2017-09-11T15:47:19Z")

</div>

I work on a couple of sites with multiple authors, some of which clients have access to. You will always have the problem of two people potentially editing the same article at the same time. I don’t think theres a way to prevent that. Heres my workflow:

**Scenario one**

2 or more developers need to work on a site

**Solution:**

_NEVER edit via the panel on the live site._ Use Git and local servers (Vagrant, MAMP, Valet etc) to keep track of content changes and handle difference. Commit after changing a page. Pull when you start work. It’s that simple. It’s possible these days to deploy automatically with Git (Plesk and cPanel can do this). Failing that, you can push your changes to live or staging automatically via [rSync](https://coderwall.com/p/moabdw/using-rsync-to-deploy-a-website-easy-one-liner-command) or [Git hooks.](https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks)

**Scenario two**

2 or more developers need to work on a site **locally** + Client has access to **live site panel** to make changes.

**Solution:**

Same as the above solution but extend the rSync rule so that it can pull the content folder in the other direction from live site to local. This will sync up your changes. I do it manually but you can probably tie it into a Git hook or an NPM script.

A useful plugin is [Kirby Logger](https://github.com/texnixe/kirby-logger). This will tell you who the last person to change a piece of content was. (I don’t use this plugin, but it might be useful to you).

This is purely the way I work, and it works for me.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 11, 2017, 3:51pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/3 "2017-09-11T15:51:59Z")

</div>

There’s also the[Auto Git](https://github.com/pedroborges/kirby-autogit) plugin that commits changes on live site automatically to your repo. I’d actually separate content from the rest of the site for that purpose. Kirby Logger was only created for websites that don’t use Git, to track who made changes.

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 11, 2017, 4:09pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/4 "2017-09-11T16:09:23Z")

</div>

> [@jimbobrjames](#):
>
> I work on a couple of sites with multiple authors, some of which clients have access to. You will always have the problem of two people potentially editing the same article at the same time. I don’t think theres a way to prevent that.

I use this plugin so if a user tries to edit a article already opened by another user a notification appears:

> **[GitHub - taikonauten/kirby-page-lock-plugin](https://github.com/taikonauten/kirby-page-lock-plugin)**
>
> Contribute to taikonauten/kirby-page-lock-plugin development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [September 11, 2017, 4:09pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/5 "2017-09-11T16:09:47Z")

</div>

> [@texnixe](#):
>
> Kirby Logger was only created for websites that don’t use Git, to track who made changes.

Sure, but Git won’t necessarily track a change made by a non-technical client who only has panel access, so I think its potentially still useful?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 11, 2017, 8:28pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/6 "2017-09-11T20:28:28Z")

</div>

> [@jimbobrjames](#):
>
> Sure, but Git won’t necessarily track a change made by a non-technical client who only has panel access, so I think its potentially still useful?

The Auto-Git plugin tracks changes to the content folder only, but with user names attached. But if you mean a non-technical user would not be able to view such changes, then yes, that’s right. A Panel widget to view such changes in the Panel was planned at one time, but so far never implemented. But as I said above, I created the Kirby Logger plugin mainly as an alternative to Auto-Git for people who can’t or don’t want to use version control. So yes, it is still useful, I think.

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 12, 2017, 10:58am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/7 "2017-09-12T10:58:57Z")

</div>

Ok, thank you for all the input.

So… my plan so far:

1 Live server: with the kirby website + GIT plugin but without Panel  
1 ‘inhouse’ Staging server with the website that also is the GIT repo and with Panel

1.) all editors/developers edit content/code on the inhouse staging server… GIT will keep track of all changes  
**_2.)_** content/code will be pulled from the live site… if a webhook is called? (a button pressed… maybe not possible due the lack of panel on the live server…hmm)  
**_3.)_** live site pushes changes to the staging server e.g. comments id content changed… user commented a article.

is **_2.)_** and **_3.)_** possible with @pedroborges AUTO-GIT plugin?

Svnt

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 12, 2017, 11:10am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/8 "2017-09-12T11:10:34Z")

</div>

> [@Svnt](#):
>
> Live server: with the kirby website + GIT plugin but without Panel

The Auto-Git plugin relies on Panel events; if you don’t install the Panel on the live server, you will have to trigger those events in your comment handling script.

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 12, 2017, 11:17am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/9 "2017-09-12T11:17:45Z")

</div>

> [@texnixe](#):
>
> The Auto-Git plugin relies on Panel events; if you don’t install the Panel on the live server, you will have to trigger those events in your comment handling script.

if this is possible… great!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 12, 2017, 11:21am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/10 "2017-09-12T11:21:14Z")

</div>

Yes, that’s possible with `$kirby->trigger($event, $args = null)`

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 12, 2017, 11:25am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/11 "2017-09-12T11:25:28Z")

</div>

To prevent the event to be fired two times i have to check for the panel like this? -\> [Check if it is panel](https://forum.getkirby.com/t/check-if-it-is-panel/4435/2)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 12, 2017, 11:34am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/12 "2017-09-12T11:34:26Z")

</div>

Why should the event fire twice if you don’t use the Panel?

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [September 12, 2017, 11:36am UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/13 "2017-09-12T11:36:10Z")

</div>

> [@texnixe](#):
>
> Why should the event fire twice if you don’t use the Panel?

Because the staging server does have the panel and the same codebase than the live server.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 12, 2017, 12:28pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/14 "2017-09-12T12:28:57Z")

</div>

Yes, but I don’t think the events would interfere. Let’s say you make a change via the Panel, panel fires event as it should. If you make a change on the frontend, frontend script fires event as it should. Both Panel and frontend events only fire if a change occurs. But of course you could check if the Panel exists, wouldn’t do any harm, just don’t think it’s necessary unless I am missing something 🤔

---

<div class="post-metadata">

**Author:** ![pedroborges](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/pedroborges/32/7038_2.png) [@pedroborges](https://forum.getkirby.com/u/pedroborges)\
**Post date:** [September 12, 2017, 5:16pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/15 "2017-09-12T17:16:39Z")

</div>

You can call Auto Git directly and even add new types of messages:

```php
// Just call it from the logic to add comments
// after the content text file have been updated
autogit()->save('page.comment', $page->uri());

autogit()->save('page.rating', $page->uri());

```

Then use the `autogit.translation` option:

```diff
c::set('autogit.translation', [
    'site.update' => 'Changed site options',
    'page.create' => 'Created page %s',
    'page.update' => 'Updated page %s',
    'page.delete' => 'Deleted page %s',
    'page.sort' => 'Sorted page %s',
    'page.hide' => 'Hid page %s',
    'page.move' => 'Moved page %1$s to %2$s',
+ 'page.comment' => 'Comment added to page %s',
+ 'page.rating' => 'Rated page %s',
    'file.upload' => 'Uploaded file %s',
    'file.replace' => 'Replaced file %s',
    'file.rename' => 'Renamed file %s',
    'file.update' => 'Updated file %s',
    'file.sort' => 'Sorted file %s',
    'file.delete' => 'Deleted file %s',
]);

```

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:32pm UTC](https://forum.getkirby.com/t/working-as-a-team-on-a-kirby-website/8476/16 "2025-02-06T17:32:09Z")

</div>

Archived on February 6, 2025, 5:32pm UTC


