Update Page custom attribute value from a block
PermalinkCan anyone help, I have been finding it hard to work out how to update a page attribute from a block.
Regards
Adam
So the page will have one block which when updated will update the content on the page, then the outputted HTML will put into a HTML custom field which can then be used when using the page list block.
I have the same issue. Did you figure out how to do it?
Thanks
Page::setAttribute('key', value);
Any hints?
Page::getCurrentPage()->setAttribute('key', value);
public function save($data) { $p = Page::getCurrentPage(); if(is_object($p)) { $p->setAttribute(CollectionAttributeKey::getByHandle('handle'), $data['key']); } }
I think the important part is to get the Handle! The API implies you can use the handle direclty, but, in my case, it's not true.
What is the attribute you're trying to change?
-Jordan