Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6030971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:06:57+00:00 2026-05-23T05:06:57+00:00

How do I tell CakePHP 1.3 to pull all images that have the same

  • 0

How do I tell CakePHP 1.3 to pull all images that have the same gallery_id matching the gallery_id of the current Image View? I am trying to find all images for a Gallery using FindAllByGalleryId. In the view there is one big picture for the image view, and thumbnails below it of all other images in the same gallery.

Everything works when I enter an actual Gallery ID number (as shown here), but that Gallery ID number changes depending on which Gallery is being viewed – so I don’t want it to be set to a specific number – I want it to match the gallery_id of the image being viewed.

$this->set(
    'all_images',
    $this->Image->findAllByGalleryId('2')

);

What is needed is to set the current gallery_id as the variable and then tell the Find conditions to match it. Problem is that I don’t have the right syntax, so the error comes up that the gallery_id variable does not exist.

I have tried setting find conditions to ‘Image.gallery_id’ => ‘$gallery_id’ and similar stabs at identifying the current item’s gallery_id to be matched, but I’m clueless after working at this for some time. Any direction would be greatly appreciated!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:06:58+00:00Added an answer on May 23, 2026 at 5:06 am

    Try using $this->set('all_images', $this->Image->findAllByGalleryId($this->Image->data['Image']['gallery_id']));

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make a view that shows unrelated data from multiple tables. I
In my CakePHP application layout I have a section for latest posts that needs
I created two plugins in the CakePHP, and both of them have the same
I have a backend data management console written with CakePHP that allows a user
I have a cakePHP application that is pulling data from two different databases, which
Please tell me why my window doesn't render. Below is the javascript that i
Cakephp is giving me some problems as I have set as below (I have
I've developed a website using CakePHP and I am now trying to host it
I am developing a travels related website using cakephp. I have to put some
I'm Using CakePHPs standard Auth mechanism, but I have some problems with that. Everytime

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.