Impresspages - set meta title/description from plugin's PublicController?

StackOverflow https://stackoverflow.com/questions/23486965

  •  16-07-2023
  •  | 
  •  

Question

Is there any way to set page-specific attributes for plugin in PublicController, like seo meta tags (title, description, keywords) or push it to breadcrumbs? I figured that I can easily set layout file for plugin, but can't go any deeper.

Était-ce utile?

La solution

If you return an \Ip\Response\Layout object in your controller, you can use methods like ->setKeywords(), ->setDescription() ...

If you simply return a string leaving the layout to be generated by ImpressPages, you can add a filter which would add required meta information before outputing it. Here is an example that sets favicon https://github.com/impresspages-plugins/Favicon/blob/master/Filter.php

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top