NikolaiMorozov Davis I'm not trying to change head metadata through the API - I'm accessing page data on PrepareApiData event (cant find another way) to set head metadata. I can't do it in JS because socials parse head metadata in nojs mode.
NikolaiMorozov Davis maybe ConfigureClientView (no ConfigureWebView in my installation ?)? But how to access the variables in it?
Davis NikolaiMorozov https://github.com/flarum/core/blob/master/src/Event/ConfigureWebApp.php https://github.com/flarum/core/blob/df247925d457e2f58f1a387b8d0dca9eb53050ac/src/Http/WebApp/WebAppView.php
Davis NikolaiMorozov https://github.com/flarum/core/blob/v0.1.0-beta.5/src/Http/Controller/AbstractClientController.php
NikolaiMorozov Davis yep, I'm using ConfigureClientView event to get ClientView and set default metatags. But how to access Discussion/User/... page data from it?
Davis https://github.com/flarum/core/blob/v0.1.0-beta.5/src/Http/Controller/ClientView.php Try using request? Sorry don't have much time to do this I'm not at my computer either. You should just dig through the source code and figure it out that way.
NikolaiMorozov Davis You should just dig through the source code and figure it out that way. Thats what I tried. And couldn't find solution so i came here ?
NikolaiMorozov Davis Thx, but allmost all the time it's ClientView, so can't use it. ChallaPradyumna Yep, but wich image should i use? Favicon? First image in discussion? For now socials allow you to chose image if they find any on page.
ChallaPradyumna NikolaiMorozov First image would be great because favicon will get repetitive. If it can pull images off imgur if there is a imgur link that would be extra awesome. Currently i am using imgur to post images since there is no official way to upload images to the forum and eventually when the feature comes i dont want to duplicate effort
NikolaiMorozov Davis I mean it's ClientController in $this->action allmost all the time - for example /u/user and /t/tag have ClientController in action on page open.
Davis NikolaiMorozov ugh... I think this might just have to be something I download to my development environment and play around with. Are there any other events you could listen for? Maybe try accessing the Request variable and taking the request URL from it?
NikolaiMorozov Davis I'm realy hope there are another way to access data except PrepareApiData event, because it's realy not the right way. But request usage is nice idea. ChallaPradyumna I think about extention that require this one and Flagrow image uploader mentiond by @Davis. It will fill og:image.
Davis ChallaPradyumna https://discuss.flarum.org/d/1836-flagrow-image-upload-image-uploader-for-flarum-forum-messages
ChallaPradyumna NikolaiMorozov Davis Finally wrote it myself. og:image works now. Submitted a pull request ?