Jump to content

a-ok

Members
  • Content Count

    641
  • Joined

  • Last visited

Community Reputation

67 Excellent

About a-ok

  • Rank
    Hero Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Why does this return null? $page->products_sku->type I thought you could check a field's type? I know this works... $fields->products_sku->type But if I have the following, how could I check the type? $slides = $page->products_sku; // I need to return $slides type bd($fields->products_sku->type);
  2. Perfect. Thanks so much. I like the idea of using ProTable for this rather than a Repeater to reduce overheads. Much appreciated everyone.
  3. Omg what? I’ve been paying for it since then too (upgrades and support) haha! I’ll upgrade and check!
  4. Ah but it looks like I cannot add a PageField as a column type?
  5. Okay great so that's the best way to do it. ProFields Table! I prefer this to the Repeater field too. I really appreciate everyone's help. I think I'll add the JS to a hook under ready.php (stupidly I didn't know you could add JS to this?)
  6. Correct but the total code is only based on the product with one source. Product D with source Z = 123, Product D with source D = 456, Product D with source H = 789. There is a single code per product+source. The client states this. It needs an entry for each 'source' they choose per product. I reckon your method makes sense but just seems time consuming for the client but maybe that's how it is. Why they couldn't just have a code for each source and code for each product and the total code is them concat'd together. But alas. It shouldn't matter based on my explanation above.
  7. This isn't a bad idea and is how it is almost set up just now but just seems like A LOT of data input for very little return? Having to add each total code separately, outside of the product context, then reference a product and source (assuming by two PageFields on the total code page?) – it might be the only solution, however!
  8. No, sorry. I have clearly confused everyone. Each product has a 'light source' PageField which chooses the 'light sources' for each product. One product may have 10 light sources, another maybe one. The issue is that I need to add a 'unique product code' (almost like a SKU) that only exists for a product and light source combination. So if I was editing product A and chose LED35 GEN2 from the light source I would need to enter a unique code for that combination of product and light source. Same if I then choose another light source. Then when editing another product (product B) and adding a light source to that, it would, again, be unique/different. I need a way, when choosing a light source for a product, to enter a unique code for that selection, for each selection. This needs to be inputted manually. Hope that's cleared things up?
  9. It's interesting and really appreciate your reply. The only issue is I try to keep things as three dimensions as possible so no rabbit holes. Product and source are all their own tree so everything is on the same level. I use @Robin S's PageFieldConnector module which seems to work well but I can't see it being useful in this instance. The total code is only relevant to the product and source code chosen (by PageField at product level) in that context/instance.
  10. I'm building a website that houses all different kinds of 'lights'. Lights (let's call them 'products') are all pages and a 'product' can have any number of 'light sources'. Each 'light source' is a page and within a 'product' you can use the PageField field to select as many options as you want. Easy. Each 'product' and 'light source' combination has a unique 'code' but I'm struggling to work out where to add this. It would be ideal if each product has a code and each light source has a code then the total code is them both together... but it's not. A total code is random – there's no 'formula' – so I'm wondering how best to implement this? Ideally it would be some sort of 'Within your product you choose your light source and supply the code at the time of choosing' – but that's not possible. Do you think, on save, using a hook, it could populate a repeater field or table with the 'light source' pages chosen and each 'row' has a separate field for the code? I need to output this on the front end too but I could cross reference the PageField (light sources) with the hooked repeater and return the total code that way? Does anyone know if I'm missing something obviously simple to allow this sort of functionality or is my suggestion the best route? Thanks!
  11. This is amazing. PW is so so so good. Much appreciated, @Robin S and the others
  12. I'm trying to be smart and use the `owner` selector. I'm using a repeater `projects_awards` on a `projects` template that has about 20-30 pages and want to retrieve all the repeater rows on a separate page `About`. I could either query all the projects, that have `projects_awards.count>0` then loop through those but that doesn't seem very efficient. I could just query the repeater template `template=repeater_projects_awards` but then that would return the rows even if the page it is on (owner) is unpublished. You see my dilemma. I thought this could work... template=repeater_projects_awards, projects_awards.owner.status!=2049, include=all But returns empty – am I using this correctly?
  13. Thanks again, @szabesz for this! Made building it all in modules a lot more efficient and obvious now. Much appreciated.
  14. Thanks, this is really great and helped me loads. Is there a reason you use $config->paths over $config->urls?
  15. Thanks all. I ended up using wireRenderFile() for all the includes. Is this a more preferred way?
×
×
  • Create New...