• Content count

  • Joined

  • Last visited

Community Reputation

111 Excellent

About cb2004

  • Rank
    Sr. Member

Recent Profile Visitors

2,393 profile views
  1. This module has been out 2 weeks, if in 6 months it is full of bugs and security issues and nothing is being done let's revisit this post. There should be positivity around this, not negativity.
  2. Thanks so much @abdus. Sometimes my brain freezes up with all the selector stuff. Thats a nice optimisation for my site.
  3. So I am finding the pages from a given rootparent that have a manufacturer assigned, I then turn this into a unique array to display logos, but how would I count this first? $pages->count("???"); Cheers.
  4. Perfect. Full code: foreach ($pages->get(3780)->find("imagesMain!=, drupalAlt!=") as $p) { $p->setOutputFormatting(false); $imagesCount = count($p->imagesMain); $descriptions = array_filter(explode("|", $p->drupalAlt)); if($imagesCount === count($descriptions)) { for($i = 0; $i < $imagesCount; $i++) { $p->imagesMain->eq($i)->description = $descriptions[$i]; } } $p->save(); $p->setOutputFormatting(true); }
  5. So I have my image field, and I also have my image descriptions in 1 text field seperated by |, these are in the correct order. I am trying to apply the images descriptions to the images but I am having a brain fart. My start is: foreach ($pages->get(3780)->find("imagesMain.count>0") as $p) { $p->setOutputFormatting(false); $imagesCount = count($p->imagesMain); $descriptions = explode("|", $p->drupalAlt); $descriptionsFiltered = array_filter($descriptions); if($imagesCount === count($descriptionsFiltered)) { } $p->save(); $p->setOutputFormatting(true); } In some places the images are not present yet but the descriptions are, hence the if($imagesCount === count($descriptionsFiltered)) check. So, in there I want to foreach on the imagesMain and apply the descriptions in order. Cheers for any help.
  6. What does the file path need to be? This is working great with a full http:// but something like this: /sites/default/files/product-images/image.jpg Is not working. Any advice would be great.
  7. I think if the site works for you with no issues, the dev tag is completely irrelevant. I use the dev branch on a lot of sites that are live, ProcessWire has always been very stable, which is why it is my CMS of choice.
  8. Ah ok, so the page I am looking for could be a child or a sibling. Interesting.
  9. In fact some templates can be found, others cant, are there any stipulations?
  10. It doesn't seem that $page->closest("template=X") is working, should it?
  11. Amazing, but I would love to be able to select this to display in a tab without the label (but the label would be used as the tab title).
  12. Or if not I do believe this is put their in readiness by your hosting company that you may wish to. It may even be enabled without you knowing, try going to the https:// version of your site and see what it says.
  13. I do believe this is to do with Let's Encrypt SSL certificates and I don't think this is anything to worry about. Malware with ProcessWire, pah
  14. Awesome work DaveP, with some brackets around the $page->parents we got there: $ctas = $pages->find("id=1|2, id!={$page->parents->append($page)}, sort=sort; Virtual beer your way Sir.
  15. I am creating some calls to action and I am banging my head against the wall for something which I know is simple. Lets say my structure is: - Books (id = 1) -- Book Year --- Book - Videos (id = 2) -- Video Year -- Video So on my whole template in a side bar I want to link to Books and Videos so: $ctas = $pages->find("id=1|2, sort=sort"); Nice and simple. To stop the link to itself when I am on the page this is: $ctas = $pages->find("id=1|2, id!=$page, sort=sort"); But lets say I am in Book Year or Book, I don't want to display a link to the parent Books as I am already in a child and this is handled by breadcrumbs. I have tried so many selectors I think I have exhausted them all, so I must be missing something. Cheers.