Jump to content

Search the Community

Showing results for tags 'module developement'.

  • 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. Hi, Thanks again for great CMS. I was trying to create a module that can create a new template file and fields. Here is my module script: class NewsPager extends WireData implements Module{ public static function getModuleInfo() { return array( 'title' => 'News pager', 'version' => 001, 'summary' => 'News pager testing!', 'singular' => true, 'autoload' => true, ); } public function init() { //todo add some listeners } /** * Install the module * */ public function ___install() { // new fieldgroup $fg = new Fieldgroup(); $fg->name = 'new-template9'; $fg->add($this->fields->get('title')); // needed title field $fg->add($this->fields->get('body')); // needed title field $fg->save(); // new template using the fieldgroup $t = new Template(); $t->name = 'new-template9'; $t->filename=$this->config->paths->templates . 'news-pager-index.php'; $t->fieldgroup = $fg; // add the fieldgroup $t->save(); } /** * Uninstall the module * */ public function ___uninstall() { $templateNeeded = $this->templates->get("new-template9"); if ($templateNeeded->getNumPages() > 0) { throw new WireException("Can't uninstall because template been used by some pages."); }else { wire('templates')->delete($templateNeeded); } } } The module works fine. But when I try to create pages by using newly created template, in that case the view link is not appearing. Is there any property that I should use for template creation to get view link to be worked. Thank you
×
×
  • Create New...