I'm looking to hit a method on page load for certain document types. This will allow me to check if the page (retail page) has products before the page has loaded. If not I can update the page status which should help to rank the page with Google.
I know there is the ApplicationEventHandler which has ApplicationStarted, is there anything that I can override so it triggers on the start of page load so i can get in there to update the status before its too late?
The name of your controller must match your document typename, and the method name must match the template name. E.g. below, I have a document type called "Product" and a template attached to it called "Product".
public class ProductController : RenderMvcController
{
public ActionResult Product(IPublishedContent content)
{
}
}
This is the solution im trying to avoid. We have multiple different document types for products and this would need this check on each one. I could create a link to a helper controller which could do the same but im trying to future proof the site so we can extend the if needed. A page load method would work better but if not this is the route I will go down.
On page load
Hi all,
I'm looking to hit a method on page load for certain document types. This will allow me to check if the page (retail page) has products before the page has loaded. If not I can update the page status which should help to rank the page with Google.
I know there is the ApplicationEventHandler which has ApplicationStarted, is there anything that I can override so it triggers on the start of page load so i can get in there to update the status before its too late?
Thanks, Lewis
Hi Lewis,
What status do you want to return ?
Dave
I'd consider a RenderMvcController.
The name of your controller must match your document typename, and the method name must match the template name. E.g. below, I have a document type called "Product" and a template attached to it called "Product".
Hi Alex,
This is the solution im trying to avoid. We have multiple different document types for products and this would need this check on each one. I could create a link to a helper controller which could do the same but im trying to future proof the site so we can extend the if needed. A page load method would work better but if not this is the route I will go down.
thanks, Lewis
is working on a reply...