stom66

CMSMS Plugins content_type

Nov 14th, 2017
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // A simple function to change the content type of the current page
  3. //
  4. // Ported from a UDT written by RolfTj @ https://www.cmscanbesimple.org/blog/create-dynamic-sitemaps-and-robots-txt#pages
  5. // Place in /assets/plugins/function.content_type.php
  6. // Use i param for shorthand
  7. // Use 'type' param to set type
  8. //
  9. // Examples:
  10. // {content_type type='text/plain'}
  11. // {content_type type='application/manifest+json'}
  12.  
  13. function smarty_function_content_type($params, &$smarty) {
  14. $content_type = get_parameter_value($params,'type');
  15. if ($content_type != '') {
  16. cmsms()->set_content_type($content_type);
  17. }
  18. }
  19. ?>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×