enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

published.last #5517

Open ComLock opened 7 years ago

ComLock commented 7 years ago

modifiedTime is not affected by a publish (stays same on draft and master)

So I think a published.last might be a good idea.

Then you can show on the webpage when the page was actually last updated on master. Not whenever stuff happened on draft.

sigdestad commented 7 years ago

Interesting idea. Do you need this in order to sort on "last updated" or something like that? What are the use-cases?

ComLock commented 7 years ago

There is a use case for this at mantena. They want to sort articles in that manner.

  1. sep. 2017 12:30 skrev "Thomas Sigdestad" notifications@github.com:

Interesting idea. Do you need this in order to sort on "last updated" or something like that? What are the use-cases?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enonic/xp/issues/5517#issuecomment-328068693, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHQP8T4kE0_c6BGBCT8bHHPum00ObdSks5sgRdZgaJpZM4PAEFD .

sigdestad commented 7 years ago

I understand that they want to sort, but what is the "rule" they want to sort by?

ComLock commented 7 years ago

published.last ???

On Tue, Sep 12, 2017 at 8:13 AM, Thomas Sigdestad notifications@github.com wrote:

I understand that they want to sort, but what is the "rule" they want to sort by?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enonic/xp/issues/5517#issuecomment-328748593, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHQP18XUq86lP3XN6UwngeQFdECkghwks5shiEXgaJpZM4PAEFD .

sigdestad commented 7 years ago

Well.. Even if it was not modified? Also "published.last" is not a good name imho. Maybe "publish.time" makes more sense?

ComLock commented 7 years ago

I believe the modified field doesn't get updated on publish. After first publishing a content on day A, you could edit it several times and save to draft say on day B. And then publish it again on a specific day say day D.

Currently it's only possible to sort on A and B, not D.

I guess unpublish does not remove published.first ?

Both names works.

On Tue, Sep 12, 2017 at 9:24 AM, Thomas Sigdestad notifications@github.com wrote:

Well.. Even if it was not modified? Also "published.last" is not a good name imho. Maybe "publish.time" makes more sense?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enonic/xp/issues/5517#issuecomment-328764097, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHQP_pxcV8giAlqiuanbuXdE4JV05qDks5shjHIgaJpZM4PAEFD .

sigdestad commented 7 years ago

Maybe solution is a "touch" date in metadata, similar to how its done with files?

ComLock commented 6 years ago

Relevant discuss thread: https://discuss.enonic.com/t/editing-an-article/1216

ComLock commented 6 years ago

Some code I made for a customer:

<input name="postSort" type="ComboBox">
            <!--label>Post sort</label-->
            <label>Artikkel rekkefølge</label>
            <occurrences minimum="0" maximum="1"/>
            <config>
                <!-- https://github.com/enonic/xp/issues/5518 virtual fields -->

                <!-- ⌃↑▲△▴▵⇑⇡⇧⟰⤊ -->
                <!-- ⌄↓▼▽▾▿⇓⇣⇩⟱⤋ -->

                <option value="publish.first DESC">Første publisering ↓ (standard)</option>
                <option value="publish.first ASC">Første publisering ↑</option>
                <option value="displayName ASC">Navn →</option>
                <option value="displayName DESC">Navn ←</option>
                <option value="_manualordervalue DESC">Manuell ↓</option><!-- NOTE I wonder how this works in a tree -->
                <option value="_manualordervalue ASC">Manuell ↑</option>

                <!-- https://github.com/enonic/xp/issues/5517 published.last -->
                <!--option value="publish.last DESC">Sist publisert ↓</option>
                <option value="publish.last ASC">Sist publisert ↑</option-->

                <option value="publish.from DESC">Publisert fra ↓</option>
                <option value="publish.from ASC">Publisert fra ↑</option>

                <!--option value="data.datePublished DESC">Overstyrt publiseringsdato ↓</option>
                <option value="data.datePublished ASC">Overstyrt publiseringsdato ↑</option-->
                <option value="modifiedTime DESC">Endret ↓</option><!-- Publish does not change modifiedTime -->
                <option value="modifiedTime ASC">Endret ↑</option>
                <option value="createdTime DESC">Opprettet ↓</option>
                <option value="createdTime ASC">Opprettet ↑</option>
                <option value="publish.to DESC">Publisert til ↓</option>
                <option value="publish.to ASC">Publisert til ↑</option>
            </config>
            <!--
                Do not set a default here as it will break fallback nesting (part will override)
                Lets set default in js instead.
                <default></default>
            -->
        </input>
rymsha commented 1 year ago

publish.first is a day A (before day D publish.first == publish.from) modifiedTime is day B publish.from is a day D - as it is always changed when the next publishing happens

rymsha commented 1 year ago

It appears that if content was re-published on top of published content (without unpublishing), publish.from is not changed - ~it seems like a bug~. This is expected and should be kept for backwards compatibility