Jump to content

Search the Community

Showing results for tags 'module allowedTemplates'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. How do I retrieve the allowed templates when hooking on processPageAdd::getAllowedTemplates ? <?php class AllowedTemplates extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'AllowedTemplates', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('ProcessPageAdd::getAllowedTemplates', $this, "allowedTemplates"); } public function allowedTemplates($event) { $pid = wire("input")->parent_id; if(!(int)$pid) return; $parent = wire("pages")->get($pid); if(!$parent->id) return; // should be made dynamic, but I don't know how to retreive the templates array !!! $templates = wire('templates')->find("name=basic-page|sitemap"); $event->return = $templates; } }
×
×
  • Create New...