Jump to content

Search the Community

Showing results for tags 'page reference field'.



More search options

  • 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
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


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

  1. Hi everybody! I'm new to PW and just did the beginner-tutorial “Hello Worlds”, a beginning ProcessWire tutorial --> Link After extending the template from the original tutorial with a page_reference-Field (Page-Field value type is configured as single page), PW throws a fatal error when i try to output multiple pages: $planets = $pages->find("template=planet, sort=-title"); foreach($planets as $planet) { echo $planet->title; echo $planet->planet_reference->title; } Should return three Pages, but throws the following error: When i try to output the field with a single page, everything just works fine: $planet = $pages->get(1018); echo $planet->title; echo $planet->planet_reference->title; I've tried to solve the problem with myself (and google), but i can't fix the error. Thanks a lot! My enviroment: OSX Mojave / MAMP (PHP 7.2), PW v 3.0.123
  2. Hi, I'm working on a website where in the back-end in one template i have multiple page reference fields using the same conditions (parent and template). Is there a way if i selected a page in field A it won't show up anymore in the list of field B or field C etc? I was looking at creating a custom string but i couldn't wrap my head around it.
  3. Is it somehow possible to limit the number of pages one can select with the page reference field? I have a case where I need to have exactly three, not more, not less. Is this doable with a hook? Or would you suggest another approach? (three single pageref fields and make each mandatory)
  4. Good afternoon, I am attempting to loop through approximately 600 XML nodes. Each of those nodes has 2 child nodes (example below). One is an id for an existing page and the other contains values for a page reference field. I have put together a loop (below as well) to attempt to save each page with the label values. This all works....once. After getting the first XML node "label" saved to the correct page, nothing else is saved. I'm sure there is probably something that I have overlooked. But, I am also very new to this CMS. I'm hoping there is a veteran user who may be able to point me in the right direction. <row> <id>1041</id> <labels>lifestyle|savings</labels> </row> foreach ($xml->row as $items) { //get page id to update and set output formatting to false $blog_page = $pages->get('id='.$items->id); $blog_page->of(false); //create array from pipe separated label values $labelsArray = explode('|', $items->labels); //loop through array to get page ids by page name $labelIDS = array(); foreach ($labelsArray as $labelValue) { $labelPage = $pages->get('name='.$labelValue); array_push($labelIDS, $labelPage->id); } //add labels to label field in post $blog_page->labels = $labelIDS; //save page $blog_page->save(); }
  5. Good Day. I have created a repeater field on a website that I am building. Three of the fields within the repeater uses page reference fields (I hope that's the correct terminology). Everything works fine, except that I cannot get those three fields to display the Title and not the page IDs. I've tried different syntax, however I cannot seem to get this to work. I used a repeater template (repeater_sd_note.php file), as Ryan had mentioned. This works great. I have included these screenshots, that will hopefully help someone to guide me in the right direction. Screenshot 1 - A portion of what the web display looks like. Screenshot 2 - A portion of what the backend display looks like of the Screenshot 1 web page. Screenshot 3 - The sd_note repeater field contents. Screenshot 4 - The template file used on the web page. Screenshot 5 - A portion of the Zurb Foundation _main.php file that covers the rendering of the repeater. Screenshot 6 - The contents of the repeater_sd_note.php file. I have read quite a few forum articles and website documentation on repeaters, however I didn't find anything that I thought covered this subject. I apologize if a solution to this can be easily found. I worked on this for two days already. Thanks in advance. Using ProcessWire 2.4.1
  6. Hi, I need a selector to find pages that are using the template "poi" and that are having a page reference to a page with the title "Zoo". The page reference field is called poi_type. How would I do this? I tried this: $poi = $pages->find(template=poi, poi_type.title='Zoo'); But it doesnt work because there is no field poi_type.title. /Jasper
  7. Hi, I must be missing something very basic here. I have the following code: $ref_page_id = $page->ref_page; $ref_page_title = $pages->get($ref_page_id)->title; But for some (probably a very good one) reason it doesn't work. In text: On the current page I have a Page reference fied called ref_page. When I echo $ref_page_id after the first line, it contains the page id of the reference page. So far so good. But the second line doesn't produce the correct result. $ref_page_title says Home. It works when I write the page id manually, like: $ref_page_title = $pages->get(1243)->title; What am I missing? /Jasper Edit: it does work when I add a second page to the page reference field.
×
×
  • Create New...