Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Is it possible to get a published page HTML in code? We need to post a page HTML to our Funnelback Search API on the "Published" event. So instead of scraping the page - is it possible to get the full HTML via code?
Thanks
Hi Jon,
it seems like this might work:
https://our.umbraco.com/documentation/reference/querying/umbracohelper/#rendertemplateint-contentid-int-alttemplateid
GitHub Code
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web/UmbracoComponentRenderer.cs#L46
How easy is this to use inside a Class on the Publish Event?
I'm not sure but it should work.
Have you tried to implement it and did you have any issues?
Hi Jon
I do this with my Full Text Search package.
You can see the code here: https://github.com/skttl/umbraco-fulltextsearch8/blob/7b32850ba662bcaeeea6aba04da38eacad8b59e7/src/Our.Umbraco.FullTextSearch/Services/CacheService.cs#L45
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 8 - Get page HTML in code
Hi,
Is it possible to get a published page HTML in code? We need to post a page HTML to our Funnelback Search API on the "Published" event. So instead of scraping the page - is it possible to get the full HTML via code?
Thanks
Hi Jon,
it seems like this might work:
https://our.umbraco.com/documentation/reference/querying/umbracohelper/#rendertemplateint-contentid-int-alttemplateid
GitHub Code
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web/UmbracoComponentRenderer.cs#L46
How easy is this to use inside a Class on the Publish Event?
I'm not sure but it should work.
Have you tried to implement it and did you have any issues?
Hi Jon
I do this with my Full Text Search package.
You can see the code here: https://github.com/skttl/umbraco-fulltextsearch8/blob/7b32850ba662bcaeeea6aba04da38eacad8b59e7/src/Our.Umbraco.FullTextSearch/Services/CacheService.cs#L45
is working on a reply...