Zeka 944 Posted January 7 Hi. Could someone provide real cases when you use $page->meta to store data? Thanks. Share this post Link to post Share on other sites
MoritzLost 784 Posted January 7 My module TrelloWire module uses $page->meta as an easy, site-independent way to associate module data with a page. The module creates Trello cards for new pages, and can update them through Trello's API whenever the page is changed. To do this, the module needs to store the ID of the card associated with that page somewhere. Using $page->meta was the easiest option, much simpler than creating a custom database table or programmatically creating a field when the module is installed. The caveat is that the value can't be updated or deleted through the user interface. However, that could be achieved through hooks. You can see how I store and use the page meta data in TrelloWire::createCardForPage and TrelloWire::buildCardData 🙂 7 Share this post Link to post Share on other sites
bernhard 5,040 Posted January 7 RockMatrix --> thats a modules similar to RepeaterMatrix. When a matrix item is created, a meta entry stores the reference to the page, where the matrix item lives on. That's similar to the TrelloWire example 🙂 RockMeta --> that are fields for the PW backend that do not store their value in their own DB table but in page meta-data. This is great, because I can add Inputfields to existing Inputfields to make them more flexible without having to create many fields in the system. 7 Share this post Link to post Share on other sites
markus_blue_tomato 156 Posted January 7 ElasticsearchFeeder saves the document-ID returned by ElasticSearch and the time of the last sync to the correspondending page. 2 Share this post Link to post Share on other sites
Ivan Gretsky 1,283 Posted January 7 5 hours ago, bernhard said: RockMatrix --> thats a modules similar to RepeaterMatrix. When a matrix item is created, a meta entry stores the reference to the page, where the matrix item lives on. That's similar to the TrelloWire example 🙂 RockMeta --> that are fields for the PW backend that do not store their value in their own DB table but in page meta-data. This is great, because I can add Inputfields to existing Inputfields to make them more flexible without having to create many fields in the system. @bernhard, are those two publicly available? Could not find them nowhere) Share this post Link to post Share on other sites
Zeka 944 Posted January 8 @MoritzLost, @markus_blue_tomato Thanks, will look through your examples. 18 hours ago, bernhard said: RockMeta --> that are fields for the PW backend that do not store their value in their own DB table but in page meta-data. This is great, because I can add Inputfields to existing Inputfields to make them more flexible without having to create many fields in the system. @bernhard I have a request from a client to provide a batch of fields that in most cases will act as controls of hooks that should or should not be run on page save, but this fields should also save the state, so there should be some storage and I was thinking that using page meta is the good route for such task. (Though now we have Combo field that also perfectly fit). I'm also as @Ivan Gretsky interesting to see your implementation, of course, if it is possible. Thanks, guys. Best community. Share this post Link to post Share on other sites
bernhard 5,040 Posted January 8 11 hours ago, Ivan Gretsky said: @bernhard, are those two publicly available? Could not find them nowhere) Nope. Both are quite experimental at the moment. Not in the sense that things don't work, but experimental so that things might change, there are no proper docs etc... 1 Share this post Link to post Share on other sites
bernhard 5,040 Posted January 11 Just used $page->meta() for a simple maillog that shows when (date/time) a mail was sent for the currently edited page (invoice) and to whom (mail address) 🙂 1 Share this post Link to post Share on other sites