• Content count

  • Joined

  • Last visited

Community Reputation

118 Excellent

About cb2004

  • Rank
    Sr. Member

Recent Profile Visitors

2,577 profile views
  1. cb2004

    I do see your point, but after inheriting some WordPress sites this year which are absolute horror shows, it has proven to me that any project without code commenting could take some time getting to grips with. So a few small comments in the template files explaining markup regions is what I add.
  2. cb2004

    I wouldn't use any other method now markup regions exist. Love them.
  3. cb2004

    Would be a welcome addition.
  4. 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.
  5. Thanks so much @abdus. Sometimes my brain freezes up with all the selector stuff. Thats a nice optimisation for my site.
  6. 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.
  7. 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); }
  8. 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.
  9. cb2004

    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.
  10. cb2004

    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.
  11. cb2004

    Ah ok, so the page I am looking for could be a child or a sibling. Interesting.
  12. cb2004

    In fact some templates can be found, others cant, are there any stipulations?
  13. It doesn't seem that $page->closest("template=X") is working, should it?
  14. 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).
  15. cb2004

    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.