Jump to content

Search the Community

Showing results for tags 'wire()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 2 results

  1. Hi, after a long time i use processwire again. But i have a problem and can't get a solution. I have build a navigation. I have to reuse this part. So i thought, i could write a function. I have searched the forum and i learned that i have to use wire() to get access to the sites inside the function. My problem is now, that everytime i click on a new site (children of home), the menu only shows the current page and there children. I know, that's what i have coded. 😅 Without the function i could use $home to get the root site and the children. How can i acess always the root page in the function? And display all the sites? I tried to get wire("pages") instead, but i don't know how tu use the object. I would be really thankful if someone shows me the right direction. <?php namespace ProcessWire; function navigation() { $page = wire("page"); echo "<ul class='navbar-nav my-3 my-lg-0 fw-semibold rounded'>"; foreach ($page->and($page->children()) as $item) { // set the active class $active_link=""; if ($page->id == $item->id) { $active_link="nav-link active p-3"; } else { $active_link="nav-link p-3"; } echo "<li class='nav-item'><a href='". $item->url ."' class='" . $active_link . "'>" . $item->title . "</a><li>"; } echo "</ul>"; } ?>
  2. I am using ProcessWire as the back-end to manage contents on multiple sites (I call them "sub-domains"). I use ProcessWire as an editing system and database only. The ProcessWire templating system is not in use. I want to use ProcessWire's API and in particular the Include & Bootstrap method to output contents -- pretty much in the same way you do, if contents is stored in a MySQL database and output in PHP files that use PDO to load data. The issue is that I cannot get ProcessWire to fully work on each of the "sub-domains". https://processwire.com/api/include/ says: > You can do anything with ProcessWire's API that you can do from a template, > so all of this still applies, as does everything in the developer API. How can I get access to variables such as $input when using Include & Bootstrap? I tried these: $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input->urlSegment1; # Returns null $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input()->urlSegment1; # Internal Server Error $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input->urlSegment1; # Returns null $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input()->urlSegment1; # Returns null @ryan Can the API Variables documentation be updated with a section / an example that explain how to use "Include & Bootstrap" for each variable (since this is a really strong feature in ProcessWire)? $page $pages - Example: $homepage = $wire->pages->get("/"); $input $sanitizer $session $fields $user $log $templates $config
  • Create New...