Jump to content

Search the Community

Showing results for tags 'programatically'.

  • 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 2 results

  1. I'm trying to get the rendered output of a page in a custom module. In my custom Process module, I have the following: public function ___execute() { $page = $this->pages->get(1); $page->of(true); $op = $page->render(); return "Hello World"; } An exception is thrown: The srcset functionality is used liberally to generate the desired output of a page. Any suggestions on what I can do to avoid the srcset error? Edit 1: using MarkupSrcSet module: https://processwire.com/modules/markup-src-set/ - which adds the srcset method in it's ready() function. Is it possible to boostrap this prior to calling the render() function? Edit 2: bypassed the issue specific to the srcset above, it further appears that rendering output is problematic when using MarkupRegions. Title updated and tagged accordingly. Can anyone provide insight into how to retrieve the output of a page using markup regions in the template layer?
  2. How can I programatically Save() to a Page Type field that contain multiple pages (PageArray)? This attempt fails with no error message, nothing is saved: $p = $pages->get(1234); $p->of(false); $p->foo = 4321; # Page Type field, I am trying to update the ID. // $p->foo = "bar"; // $p->foo->id = 4321; # Results in "Fatal error: Exception: Item 'id' set to PageArray is not an allowed type". $p->save(); Observation: It's hard to search documentation and forum entries for this topic because the keywords Page, Type and Save are frequently used in different contexts. I guess the most logical place to find information would be on 1) the "API Variable > $page" page - and/or, the "API Variable > FieldTypes" page. My request is that the documentation at some point will cover how to programatically CRUD each core field type (Checkbox, Datetime, Email, FieldsetOpen, FieldsetTabOpen, File, Float, Image, Integer, Page, Password, (Repeater), Text, Textarea, URL). Merry Christmas and thanks. Related: Create/Update a page programmatically
×
×
  • Create New...