5

I use the following code to link to the CP from the front end:

{% if entry.isEditable() %}
  <a href="{{ entry.cpEditUrl }}">Edit entry</a>
{% endif %}

What do I have to add to link to the correct locale as it always jumps to the global locale instead of the current one?

bennobo
  • 115
  • 1
  • 5

1 Answers1

2

The following code should work for you:

 {% if entry.isEditable() %}
    <a href="{{ entry.cpEditUrl }}/{{ craft.locale }}">Edit entry</a>
 {% endif %}
Tom Bauer
  • 1,327
  • 7
  • 14