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

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

  •  16-07-2023
  •  | 
  •  

سؤال

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.

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top