Blinded by variables in CMS Images

I don’t need the actual images or text just the layout and text placements it could just be any images and any text etc I can create md and custom component, you would need to adjust for your images and data etc. then do what what you want with it. Saves me work in the end

@PMUK this is a cutdown version I just wrote but exactly the same, on my iPhone though, so might not be aligned properly under unit idunit

I am just using anchors (&) and aliases (*)


database:
  - &item1  {name: "Addon1", image: "/resources/addons/pick1.jpg", direction: "Left", size: "4"}
  - &item2 {name: "Addon2", image: "/resources/addons/pick2.jpg", direction: "Right", size: "6"}
  - &item3 {name: "Addon3", image: "/resources/addons/pick3.jpg", direction: "Center", size: "8"}


unit:
  - idunit: "Unit 1"
    price: "£100"
    class: "One"
    data: [*item1, *item2]

 - idunit: "Unit 2"
    price: "£120"
    class: "Three"
    data: [*item2, *item3] 

- idunit: "Unit 3"
    price: "£150"
    class: "Five"
    data: [*item1, *item2, *item3]

You can add to the anchors for more info to show on the page

The custom component is the loop, I just placed custom component in the item component, not the collection component, I then pointed the item component at the the actual md file. Elements CMS online cannot work with this

You can work with a md file outside of Elements edit and drop into the folder on your site just keep the original in the project. Just need to be precise on changing data in the md file, no adding other data fields

Steve I am sorry but now I am lost, I am visual person and also a copier and pater. I have tried and I really appreciate your help, there is no hurry so when you get home if you dont mind can I have a copy of the robots one you had last night. APOLOGIES but THANKS!

Sure but it is the custom component that does all the work the md file is the basic bit, might be easier if I set this one up as it will be easier to read and understand. Still do the same, if you say how many different variables there are, still 4 robots?? I assume

Then it will be just a copy paste setup images and data, you can tweak the layout as you need

If you have a lot of variants might take you a while but

@PMUK

This all custom component

ok this didnt take long I just deleted from my current template and changed the twig.
The &items, you can add info to these, just make sure format is right

I added the image for each unit and price as fixed not in the database part, just to show different format

ok see video on YouTube I just recorded this now, one go, no script just straight to point, I have a useless mic and may pick up tv, ok I talk as well

link - https://youtu.be/V2gKWyt2-Cw

here is the cut down project - elementsapp://downloadDocument/NRrJkyH2vKka

Steve THANKS but this is not the Robot one you had on last night which was just what I wanted. I know you are very good at deleting things that you do, but sadly I was not at a computer un til this morning and you changed it to this. Do you still have Robot one from last night? TUA

this is exactly the same as the robot one, just different names and page layout, I just deleted the robot stuff and replaced with this, took out a few names and saved as this, so you would need to change the names anyway to suit what you are creating, the robot version is deleted

I just added bg colors for each item in the card

You can add what you want, the database is just 3 instead of 8 from the robot version, just add 5 10 etc more &items, call everything what you want

as I said this is custom component driven, not Elements, just using item to get the php and cms

can add search

Steve not at a computer until tomorrow morning. Can you kindly leave on until then and I will look tomorrow morning. THANKS!

I’ll leave until 19:00tomorrow

Checked it works online

https://sjwjaw.co.uk/

ok because twig has math I added base price and add-on prices

Steve Had a fun day - got things working a bit but now adding all my databases, stopped for day as had to clean up one database before loading it. I am making brilliant progress so I let you know where I am up to and if I get stuck. THANKS again! Have agreta evening!

Cool, would be good see your progress, I removed the printing by the way, better add closer to you closing your layout

changed to list not finished, I still haven’t added the colors I highlighted in the front matter
you can see I adjusted frontmatter to list rather than line doesnt matter, I will use this layout for something else I am doing, it is better responsive wise, all flex as per the previous version

Would it work better if the user selected the addons to build it against the specific unit ( in my example), not really sure what you are trying to get to

Or do you have a really large number of addons

Did you try Thom’s solution as well

Steve I am just starting todays session but need to finish cleaning database first. To recap I have a “robot” there are nearly 20K of them and as the say “the possibilities are endless” :slight_smile: Basically there are subsections (characters) and I’m just doing one to get it cvorrect and then the others will be “easy”.

They have a head, a body with arms and legs. So 1 basic robot can come in around hundreds of combinations. Take head for example there are numerous facial expressions, colours etc. they may have hair - different styles and colours - a hat - once again different styles and colours etc etc. One might have two arms same colour with one coloured hand, some may have different coloured arms or hand combinations then when you add that to head you then have multiple combinations again. So I have a catalogue of pictures, all parts have a unique number and each finished “robot” has a unique SKU.

So it is a rather large relational database of pictures (parts) to make a whole. I am cracking on with yesterdays offering for now and will let you know as soon as I run into any problems but getting there. THANKS

not sure I would use this approach for that many