xp
xp copied to clipboard
published.last
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.
Interesting idea. Do you need this in order to sort on "last updated" or something like that? What are the use-cases?
There is a use case for this at mantena. They want to sort articles in that manner.
- sep. 2017 12:30 skrev "Thomas Sigdestad" [email protected]:
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 .
I understand that they want to sort, but what is the "rule" they want to sort by?
published.last ???
On Tue, Sep 12, 2017 at 8:13 AM, Thomas Sigdestad [email protected] 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 .
Well.. Even if it was not modified? Also "published.last" is not a good name imho. Maybe "publish.time" makes more sense?
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 [email protected] 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 .
Maybe solution is a "touch" date in metadata, similar to how its done with files?
Relevant discuss thread: https://discuss.enonic.com/t/editing-an-article/1216
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>
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
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