Search the Community

Showing results for tags 'page reference'.

More search options

  • 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

Found 7 results

  1. I have a PageReference field called related_random where my client selects a particular parent page in the tree. On the front end I then need to get a random child page of that page based on some selector values. At the moment I'm using a Matrix field and this outputs the page ID (1090) on the front end <?php foreach($page->related_products as $item) { if($item->type == 'related_product') echo " {$item->related_random->title} "; } ?> What I can't get my head around (and what I really want to do to echo some values of that page IDs children Essentially I want to get a maximum 1 random child page of 1090 with a template of product. The shoddy selector below is clearly wrong but correct in explaining what I want to do. $related_random->child->getRandom("template=product,limit=1") Don't know if that makes any sense?
  2. Hello, This is my first post here, I've been using processwire for a while now and having a great time with it! Quick question regarding the Pages field: I am using a multiple-select pages field on the User template, so that a dealer can be associated with each user of certain roles. This works flawlessly without any conditions being set, but if I set 'Show this field only if' to roles=dealer|dealer-admin the field shows and hides as desired, but revert to null when saved. Is there anything I'm missing here? Thanks, Tom
  3. Hello, on a fresh 3.0.62 install I have a page reference field 'mypages' with these settings for selectable pages: In my site/ready.php I have this hook: /** * custom page select */ wire()->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->name != 'mypages') return; $pages = new PageArray(); $pages->add($this->pages->get(1)); $ids = $pages->explode('id'); $event->return = $event->pages->getById($ids); }); On a normal page, the hook is working and the mypages field has only 'Home' in the select dropdown . But when I put the mypages field inside a repeater, it is not working. I have this problem on a project that is in development right now and have spent quite some time to try and find the reason. Then I made a fresh PW install to verify the behavior. No matter if repeater dynamic loading is on or off, the page reference field always returns the set of pages defined by the settings in the page reference field. The hook is ignored. Can anyone please verify this and let me know so I can file a bug report. Also if you have an idea how to fix this, I would be happy.
  4. Hi Guys, i've got a page reference field "mh_lstg" with a specific selector in it: template=lstg_mainTmpl|mh_mainTmpl, This will give me no results. If i set the ""-part to "=1070", i'll get the result as expected. The "mh_bautraeger" is also a page reference. This field is located in both templates (lstg_mainTmpl|mh_mainTmpl ). I will achieve, that i only get the data from lstg_mainTmpl, if i select in the mh_mainTmpl the mh_bautraeger-ID, that belongs to the record from "lstg_mainTmpl". Can anybody give me a tip ( assumed you know what i mean ;-) )? Many Thanks!!!
  5. I am embarrassed that I have to ask this question, but I cannot get my selector to work. I want to output a list of players that are assigned to their specific team. Each Player has a team_name field which references their team as a page field select drop down. $players = $pages->find("template=player, team_name=$page->id"); foreach ($players as $player) { echo "<li><a href='{$player->url}'>{$player->title}</a></li>"; } $page->id is referencing the team page. I have tried multiple variations using both find/get but I am missing something. Any kick in the head is appreciated. My structure is like so Players -- Player 1 Teams -- Team 1
  6. Hello, Im using the following structure Location 1 - Employee -- John Doe --Jane Doe - Department -- Confused Department --Even More Confused Each employee is assigned a department which I am using a select page reference field. I need to be able to print the title of the department. I am using the following to output my fields, but for the "department" field, I can only get it to print the id. I am assuming this is because its only a page reference field as to why it will not print the title. Any tips are appreciated $employees = $page->find("template=profile"); foreach ($employees as $employee) { echo '<tr>'; echo "<td>{$employee->first_name}</td>"; echo "<td>{$employee->last_name}</td>"; echo "<td>{$employee->job_title}</td>"; echo "<td>{$employee->department}</td>"; echo "<td><a href='{$employee->url}'>Profile</a></td>"; echo '</tr>'; I have tried echo "<td>{$employee->department->title}</td>"; with no luck
  7. The Page Reference-field seems to create a one-way link from one page to one/many other pages. This means that the related pages will only display on the referring page while not on the referred pages. Is it possible to make a two-way link that can be displayed both on the referring page and the referred pages? My Page Reference field is configured as follows: Deference in API as: Multiple pages (PageArray). Input field type: PageListSelectMultiple (Perhaps it is necessary to use another field type?)