Jump to content

Search the Community

Showing results for tags 'getTag'.

  • 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

Found 2 results

  1. Hi I have a number of pages with images and I'm having a problem selecting on the image descriptions. In the code snippet below, the I added images.description field to my selector and it does work in that I get the expected no. of matches. So findTag gets me a list of images matching the tags in the code, but if I swap that line for the commented line $match->images->find it does not work giving 0 results. There is findTag for tags but for description there is not a dedicated function, so I should use find. But what selector will give me a list of images matched by image description? Many thanks. if($q !== '') { $keywords = $sanitizer->selectorValue($q); $matches = $pages->find("template=album, title|summary|images.tags|images.description~=$keywords"); echo "<p>match count: $matches->count</p>"; foreach($matches as $match){ echo "<p>{$match->title}</p>"; $i = $match->images->findTag($keywords); //$i = $match->images->find("template=album, images.description~=$keywords"); GIVES ZERO MATCHES $j = count($i); echo "<p>No. of image matching: $j</p>"; foreach($i as $img){ echo "<img src='{$img->url}' alt='{$img->description}'>"; } } }
  2. I decided to rebuild an old image gallery site with PW. I know there's countless image-gallery scripts out there, but for my liking, most of them are too bloated. Also, I thought this was another good opportunity to dive further into PW-world. I'm keeping the old basic gallery structure: 95% of the galleries are in date-folders (monthly), like a blog archive. But I'd like to add some filter / search functionality, because there's just so many pics - when you come to the site and look for a specific subject, there was no way to do that on the old site. Q 1: How can I create a simple "search by image tag"? I want the results to list all images (thumbs) with tag x, and a link to the parent page. Q2: How would I most efficiently grab all tags from all pages, all images, and present it alphabetically (not necessary a fancy tag-cloud, but making sure I list each unique tag only once)? So when the user clicks on one tag link, he sees all image thumbs that have that tag on the results page. $p = $pages->find("images.tags~=$tag") works fine. I can explode("|", $p) to get a page-id array, but where would I go from here? A tag can be any anywhere, in various galleries (pages), and most pics have multiple tags. I'd like to group the results by page, so I guess I need to add 1-2 foreach loops, no? Can somebody help with some example code? I'm a bit stuck right now.
×
×
  • Create New...