0
Welcome Guest! Login
0 items Join Now

SOLVED Inheritance - doesn't work as expected

    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    SOLVED Inheritance - doesn't work as expected

    Posted 4 years 2 days ago
    • Hello there,

      Using Anacron for G5 - I wanted to create the following outline structure:


      Base Outline
       ^
       |
      Base Services
      ^             ^
      |             |
      Service A     Service B


      In the Outlines section, I created this stucture by clicking on the "+" and inheriting from the the appropriate base class.

      However, when examining both the Service A and Service B outlines, all the Layout sections state "Inheriting from Base Outline"? I would have expected them to state "Inheriting from Base Services".

      Have I misuderstood how the Outline inheritance works?


      Many thanks for your help,
      Marc
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 2 days ago
    • Slightly, inheritance can only go one step, You can’t inherit something that is itself inheriting as there would be no point. So the inheritance misses out the interceding inheritance step and inherits from the originating source. So, that’s why you service-A and service-B outlines show inheritance from the base outline.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 2 days ago
    • Hi Mark, thanks for getting back to me.

      Could I just clarify a couple of point to help with my understanding:

      1) "inheritance can only go one step" - if inheritance is limited to a single level, does that mean every outline can only inherit from "Base Outline" ?

      2) I created "Base Services" outline (inherited from "Base Outline"). However, when I created "Service A" I was allowed to select / "inherit" from the "Base Services" outline I had previously created. So what actually happened there? Does the Gantry framework ignore that I selected "Base Services" and actually inherit from "Base Outline" anyway?

      If I can only inherit from "Base Outline", why does the framework allow me to inherit from any other outline?


      3) How does the Layout "load" button fit into this concept? For instance, I can create a new outline "Base Services", inheriting from "Base Outline". Then create another outline "Service A" inheriting from "Base Services" (as above, and now I ubnderstand this will simply inherit from "Base Outline only).

      Now, if I make a change to "Base Services" - that change is NOT inheritied by "Service A" ... you've discussed, "Service A" is actually inheriting from "Base Outline".

      However, if from "Service A" Layout, I then 'Load' "Base Services" with the option "inherit every section and children of the selected outline" checked - I see the changes from "Base Services" reflected in "Service A". So what's happening here?

      I assume "Service A" is still only inheriting from "Base Outline", despite the option "inherit every section and children of the selected outline" checked. But at the same time, the changes from the intermeditiate outline "Base Services" have been probagated into the "Service A" outline?


      Could you please explain what is happening here and how the Load feature should be used?



      Many thanks for your help,
      Marc
    • Last Edit: 4 years 2 days ago by Marc.
    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 2 days ago
    • Actually, thinking about this - for my scenario, what I need to do is:

      - Clone "Base Outline", I.e. no inheritance. Call it "Base Services"
      - Make changes to "Base Services"
      - Create "Service A" and "Service B" outline, by inheriting from "Base Services".

      - I assume as I created "Base Services" by cloning, "Service A" and "Service B" will now inherit directly from "Base Services" - because inheritance has only been used once in this scenario. So changes in "Base Services" will be automatically reflected in both "Service A" and "Service B" ...
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 2 days ago
    • First set of questions:

      1. No. Let's take your examples. If "base services" outline has a section on the layout called "extension" that DOES NOT inherit it's content from the base outline, then when you have "service a" outline inherit the "extension" section from "base services" then it will do just that. If, on the other hand, on the "base services" outline the extension section WAS inheriting it's content from the base outline layout then the "Service A" outline would also show the inheritance from the "base outline" since there is no point in the intermediate step of inheriting from the "service a" outline. That is, inheritance only goes one step. You can't inherit something that inherits something that inherits something - it just makes no sense to do so.
      2. Gantry 5 looks at the outline that you are wanting to inherit and faithfully gives you everything from the "base services" outline. But, for those section that are already inheriting content from another outline, it make the inheritance go direct to that other outline as there I no point in the intermediate step.
      3. The LOAD button is something different again. There are two things you can do here. You can just change the layout preset (think of it as the "shape" of the outline, i.e. what arrangement of sections there are) - as part of that you can also elect to keep the content you already have placed on your existing outline layout (provided the section exists in the new layout preset). Gantry 5 will issue warnings if you are going to lose any content by changing preset. You can also change the layout preset indirectly too, by choosing an outline. In this case you are switching the layout preset AND (optionally) bringing the content from the other outline across either "cloned" or via "inheritance" (subject to the same rules I laid out in 1 above).

      Second set of questions:

      1. If your "base services" outline DOES NOT inherit any content whatesoever from the base outline layout then, yes, when you ask service a outline and service b outline to inherit from "base services" then they will do just that. I have to say though that would be missing the point a bit. "inheritance" is typically used for "common" parts of a layout, such things as "logo", "navigation", "copyright", "footer", etc etc. I can't think why you wouldn't want to just maintain those once on the "base outline"? So, "base services" should be inheriting those sections from the base outline. When "service a" outline and "service B" outline are told to inherit from the "base services" - they wouldn't implement it like that. Instead those sections would inherit from the "base outline" layout (since that is the one place you would maintain those section content) - there is no point in an intermediate step.
      2. Any changes in the "base outline" for the "common" parts of your layout would be reflected in your "base services" and "service a" and "service b" outlines.
      3. I think you may be missing something here too... "inheritance" can occur at different levels, I.e. at the particle level or the section level (not the whole outline level). The "whole outline" level is just a quick way of implementing Section and particle level inheritance (those are the levels that inheritance actually operates at).


      I hope that is now clearer.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 1 day ago
    • Hello Mark,

      Thanks so much for taking the time to describe how inheritance works in Gantry. You're right, I was thinking about this the wrong way, and looking at the outline as a complete entity being inherited. Where I should really be looking at how individual sections are inherited (or not), from outline to outline.

      May I ask one more question. Building on our scenario:
      - Create a Base Service outline, inherited from Base Outline
      - Turn off particle inheritance for a section e.g. showcase, and change the particle configuration
      - Create "Service A", inherited from Base Service
      - Service A has the Showcase particle configuration, taken from the Base Service.
      - However, if I now go back to "Base Service" and switch off particle inheritance for, say, the "Utility" section and change that particle's configuration (maybe add a new particle) ... Service A outline doesn't pick up that new change. Service A outline still 'believes' the Utility section is being inherited from Base Outline.

      In this scenario, should the Service A outline automatically pick up the 'de-inheritance' of the Utility section within the Base Service, or do I have to apply a manual process to pull in the change?

      Again, thanks for your help,
      Marc
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 1 day ago
    • Ok so in that case where "service a" was inheriting from base outline the utility section, it would never have done that because the utility section was being inherited from the base outline in BOTH "base services" and "service A" would have stated on their layouts that they were inheriting from the base outline. Subsequently breaking the inheritance on the utility section in the "base services" outline has absolutely no effect on the "service a" outline because there was never an inheritance relationship between "base services " and "service A" for the utility section.

      So, yes, if you now want the utility section on the "service A" outline to inherit the utility section settings from the "base services" outline (rather than the base outline as it's currently set) then you would just go to the "inheritance" tab of the utility section on the "base services" outline and change "base outline" to "base services".

      As I said before the inheritance operates at the "section" and "particle" level not at outline level (that merely a functional step that we provided to give you the inheritance at the level it operates).

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 1 day ago
    • Hello Mark,

      Now I'm beginning to understand the concept of outlines, your reply makes total sense. However, in practice unfortunately it didn't work:

      - In the Base Services outline, in the Utility inheritance tab, I unchecked "Particles within Section" and then added a new particle.
      - In the "Services A" outline, I then went to the inheritance tab for the Utility section and expected to be able to select "Base Services" in the inherit tab. However, the inheritance drop down only contained: No Inheritance, Base Outline, or Home - Particles. There was no option to select "Base Services".

      (Your reply stated: 'inheritance' tab of the utility section on the "base services" outline and change "base outline" to "base services" - but I assumed you meant utility section on the 'Service A" outline)

      Many thanks,
      Marc
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 1 day ago
    • No my reply was correct.

      By unchecking the "particles within a section" then you won't inherit any particles in that section from another outline unless the individual particles already in that section have inheritance in their own right. Remember inheritance operate at "section" and "particle" levels.

      From what you said previously I though you were trying to have "service a" outline inherit the entire utility section content of the "base services" outline? Therefore you, just change the inheritance tab on the section to inherit from the base services outline rather than the base outline. That will work as I described. Now you see to have moved on and want SOME content from the utility section of the base outline and want to augment this with additional particle level content in that section. So, that means you cannot inherit the particle details at the section level and must instead inherit the content of particles at the particle level.

      To be able to inherit a particle then that particle must exist on the layout of the outline from which you are trying to inherit it. So if a logo particle were on your "base outline" but NOT on your "base services" then you could only inherit it from "base outline" since it does not exist on the "base services" outline.

      This would all be far easier if you just provided admin login details in the secure tab and tell me what you're trying to achieve and I'll set it up for you.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • Marc's Avatar
    • Marc
    • Jr. Rocketeer
    • Posts: 38
    • Thanks: 0

    Re: SOLVED Inheritance - doesn't work as expected

    Posted 4 years 1 day ago
    • Hello Mark,

      As I'd like to get to grips with outlines, I would rather fully complete / understand a basic set up myself. Sorry this is frustrating for you, but I just need to work through it.

      To give you more context: I would like two "service" pages, but they have different logos and colour schemes. Consequently, I'd need a different outline for each.

      However, the layout / particles of these services will also be very similar. So I can either:

      A ) create two outlines: Service A and Service B - inherited from Base Outline and re-create the same layout in both. E.g. if I need a showcase particle in the Showcase section, I'll make this change to both Service A and Service B outlines independently.

      B ) create a "Base Service" outline, make the common layout changes there, and inherit the relevant sections in the Service A and Service B outlines.

      Being a programmer (familiar with the concept of inheritance), ( B ) appeared to make more sense. My simple set up was:

      - Initially create a new outline, "Base Service" by inheriting from "Base Outline"
      - Wanting to have a common Showcase section, I then unchecked "Particles within section" on the Showcase inheritance section, so I could then add a new showcase particle.
      - Then I created a new outline "Service A", by inheriting the Base Service outline.
      - And yes, the Showcase particle was successfully propagated to the new Service A outline. The Showcase particle-> states "inheriting from Base Service".

      However, then I want to add a new particle to the Utility section for all the services. So I then go back to the Base Service->Utility section-> inheritance tab. The Outline drop down only has "No Inheritance", "Base Outline", "Home - Particles". So here, I cannot select the "Base Service" outline as you suggested,

      Thanks again,
      Marc
    • Last Edit: 4 years 1 day ago by Marc.

Time to create page: 0.057 seconds