Jump to content

Search the Community

Showing results for tags 'find'.

  • 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 everone. I've searched the forum to find a solution to my problem, but so far nothing did the trick for me. So here's the issue: I've created a repeater called "news" and it's used on several overview pages (working perfectly). Now, on the home page, I want to show the latest 10 news, and I figured you can do this like this: <? foreach($pages->find("template=repeater_news, sort=-modified, limit=10") as $news): ?> <li><a href="<?php echo $news->getForpage()->url ?>"><img src="<?php echo $news->getForpage()->icon->url ?>"><span><?php echo $news->text_primary ?></span><br><?php echo $news->getForpage()->title ?> - <?php echo date('d/m/Y g:i a', $news->modified) ?></a></li> <? endforeach; ?> That works fine on my localhost, but as soon as I access the page via IP (like externally), the list stays empty. The same problem happens on my search page (when searching news). "Normal" pages don't seem to have the problem. Can anybody help me? Cheers and thanks
  2. I'm not able to get my array list. I have a menu template and I'm grabbing it, but it won't let me go inside it I get this error Warning: Invalid argument supplied for foreach() in /x/site/templates/includes/header.inc on line 61 $items = $pages->find('template=menu, title=Toolbar Menu, include=all'); //THIS SHOULD WORK foreach ($items->menu_item as $item) { $output .= '<li><a href="' . $item->link . '"'; if ($item->open_in_new_window) $output .= ' target="_blank"'; $output .= '>' . $item->title . '</a></li>'; } I'm attaching a screenshot of a selector test
  3. Hi there, I am struggling with a very simple variable. I'm using the following function to get the url of a certain child: <?php echo $page->find("projects")->url ?> But it returns an error: Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Selectors.php line 165) #0 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Selectors.php(190): Selectors->create('projects', '', '') #1 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Selectors.php(63): Selectors->extractString('has_parent=1, p...') #2 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Pages.php(143): Selectors->__construct('has_parent=1, p...') #3 [internal function]: Pages->___find('has_parent=1, p...', Array) #4 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Wire.php(271): call_user_func_array(Array, Array) #5 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Wire.php(229): Wire->runHooks('find', Array) #6 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Page.php(786): Wire->__call('find', Array) #7 /Applications/XAMPP/xamppfiles/htdocs/cms/wire/core/Page.php(786): Pages->find('has_parent=1, p...', Array) #8 /Applications/XAMPP/xa This error message was shown because you are logged in as a Superuser. Error has been logged. The page called 'projects' exists, what could be the problem? Thanks in advance
  4. Hello, I've tested some selectors on my site and I'm having a little question here. My 'page tree' look like this : /guests /guests/admin/ /guests/admin/Laurence /guests/admin/Le p'tit /guests/admin/Élodie As you can see, I have names with special characters. I'm trying to retrieve the pages for an autocomplete field on the front-end. So far so good, it worked ok, until I notices I had no result for 'l', that's when I added the 'Laurence' page and it worked. So I thought the problem was due to the apostrophe... Anyway, I used the new 'Selector test' module (thanks to the creator!) and noticed something : parent=/guests/41,title*=l >> returns 1 page found : Laurence (Why not 'Le p'tit' ?) parent=/guests/41,title^=l >> returns 1 page found : Laurence parent=/guests/41,title%=l >> returns 3 pages found : Laurence, Le p'tit, Élodie (no apostrophe problem?) And : parent=/guests/41,title$=ie >> returns 1 page found : Élodie parent=/guests/41,title$=die >> returns 0 pages found ? Why not 'Élodie'? So I don't really know what to think... Am I doing something wrong here? Thanks if anyone has time to give me a clue ;-)
  5. Now I look at this I see it makes sense, as we're allowed to simply type the name of a field to use it rather than some "Field = my_field" syntax (lovely PW ) I can see that whitespace could be weird to deal with so it makes sense that it must not be used; to explain this produced an error: $slideshow = $pages->find( "parent=/work/, slideshow_part_of=1, image_special.count>0, slideshow_copy != ''" ); but this was perfect $slideshow = $pages->find( "parent=/work/, slideshow_part_of=1, image_special.count>0, slideshow_copy!=''" ); the difference being the spaces either side of the != in the final test. I am guessing this is stated in the documentation or obvious or something a PHP person would know and that's how I missed it (not great at RTFM, not great at seeing obvious things and not a PHP hero ) Anyway, I just thought I post this in case it helps anyone else out fitting the above description. Totally loving the speed and power of working with PW.
×
×
  • Create New...