can i get some details of comment integration posts from WP to Vanilla?
So, I've got comment integration working, but, it's not an ideal solution to our problem.
We would like to have the full article text posted into the thread, and not just simply the first HTML "P" tag that is found on the page, or whatever logic is being used to make the snippet of content pasted into the forums after the first comment is made...
In the themes I have tried (one custom, the other WP 2012), and depending if they had sidebars or not, completely irrelevant graphics and text were being pasted as a 'preview' into the forum post... I had to modify my theme in order to get the real blog post content in there. Obviously not the best solution in any regard.
We also want the post to appear in the Vanilla forums right away, and not after someone comments on the WP blog post... that is just poor design.
So I'm looking at writing my own custom query that will make a new Vanilla forum post when the WP blog post is made, and still use the comment integration (without duplicating the topic).
Any details from the experts or Vanilla team would be appreciated. Wading into unknown territory with this architecture, and I'd rather not swim blindly if some people can give me some insight.
Comments
Vanilla basically visits you worpress page and extracts the information using this function:
https://github.com/vanilla/vanilla/blob/master/library/core/functions.general.php#L853
You can override this by just creating a plugin and copying over the whole function like this:
Then right here add something like:
$PageInfo['Description'] = $Dom->find('.postcontent', 0)->plaintext;
You might need to play around with the selector, i have no way to test this, as I don't have a wordpress blog set up.
You would either need some kind of cron functionality or create an endpoint on vanilla that is called from wordpress to trigger the creation of the discussion.
This is the part which creates the discussion when someone posts a comment on the embedded comment form.
https://github.com/vanilla/vanilla/blob/master/applications/vanilla/controllers/class.postcontroller.php#L397-L485
Another option would be to just insert the discussion into the database.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Awesome, thanks for the answers, I'll probably just do an insert into the database, but it's nice to the know the functionality of how it currently works.
I may be back to see how the comment integration works on the blog post, but I think I'll probably figure it out so it sticks around.