Jump to content

Search the Community

Showing results for tags 'Page Reference'.

  • 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

  1. Hi, I'm sure this is simple but I just can't seem to get my head around it. I have a template walk_segments which has two page reference fields start_town and end_town. Both of those fields reference walk_towns which has a Maps Marker field called marker. I would like to get a map in the Walk Segments which has markers for both the start_town and end_town. I can't figure out what to put in the selector to get that. $items = $pages->find("template=walk_towns, marker!='', $page->start_town, sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'marker'); Any help would be most appreciated! Heather
  2. 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?
  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,mh_bautraeger.id=mh_bautraeger.id This will give me no results. If i set the "=mh_bautraeger.id"-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?)
×
×
  • Create New...