Skip to main content
added 620 characters in body
Source Link
carlcs
  • 36.3k
  • 5
  • 63
  • 140

You could add a new entry type "Duplicate" to your section with just an entries field "Use content from entry".

In your template you can now overwrite your entry variable with:

{% set entry = entry.type == 'dupe' ? craft.entries.id(entry.contentFrom.first().id).first() : entry %}

You could also use the "Duplicate" entry type to link to the same entry / URL twice from your navigation:

{% nav entry in entries %}
    {% if entry.type == 'dupe' %}
        {% set entry = craft.entries.id(entry.contentFrom.first().id).first() %}
    {% endif %}
    <a href="{{ entry.url }}">{{ entry.title }}</a>
{% endnav %}

And in case someone "guesses" the URL, simply redirect them to the original entry:

{% if entry.type == 'dupe' %}
    {% set entry = craft.entries.id(entry.contentFrom.first().id).first() %}
    {% redirect entry.url %}
{% endif %}

You could add a new entry type "Duplicate" to your section with just an entries field "Use content from entry".

In your template you can now overwrite your entry variable with:

{% set entry = entry.type == 'dupe' ? craft.entries.id(entry.contentFrom.first().id).first() : entry %}

You could add a new entry type "Duplicate" to your section with just an entries field "Use content from entry".

In your template you can now overwrite your entry variable with:

{% set entry = entry.type == 'dupe' ? craft.entries.id(entry.contentFrom.first().id).first() : entry %}

You could also use the "Duplicate" entry type to link to the same entry / URL twice from your navigation:

{% nav entry in entries %}
    {% if entry.type == 'dupe' %}
        {% set entry = craft.entries.id(entry.contentFrom.first().id).first() %}
    {% endif %}
    <a href="{{ entry.url }}">{{ entry.title }}</a>
{% endnav %}

And in case someone "guesses" the URL, simply redirect them to the original entry:

{% if entry.type == 'dupe' %}
    {% set entry = craft.entries.id(entry.contentFrom.first().id).first() %}
    {% redirect entry.url %}
{% endif %}
Source Link
carlcs
  • 36.3k
  • 5
  • 63
  • 140

You could add a new entry type "Duplicate" to your section with just an entries field "Use content from entry".

In your template you can now overwrite your entry variable with:

{% set entry = entry.type == 'dupe' ? craft.entries.id(entry.contentFrom.first().id).first() : entry %}