This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

chris.e.mcquilkin11830
chris.e.mcquilkin11830

So lets say i have a component on a "layout" page and i have one of the properties set for it. Then i create a page with the layout that has the component set as the default theme the component properties does not apply. Is that normal?

because i have a Page property set then i try to make a call to it but it doesnt work.

Crazymodder
Crazymodder

Hi,

Can you please explain in more detail what you trying to archive? Maybe with some code snippets? For me the context is not clear enough.

Parsec
Parsec

I found this very confusing in the beginning. What I have done so far that works:

If you have a variable in the php of a page or a partial, to make that variable available in the page do: $this['pageVariable'] = $something;

If you have a variable in a component that you want the page to have access to do:

$this['page']['pageVariable'] = $something;

I believe this to be incorrect in the instruction video of how components work.

Hope this helps.

chris.e.mcquilkin11830
chris.e.mcquilkin11830

What i was basically trying to say was allowing component properties to work within a partial when its present in a page. (Sometimes a partial will have a partial in it - nested ). Then i read the documentation about partial life cycles. so i would have to put the component in the partial for the property to work.

I can provide a demo of the site im working on but idk the rules about posting websites on here.

Parsec
Parsec

You need to add the partial in the config section of the page or partial above the php section marked with the first '=='

You put the name there like [partialName] like you added your component in the plugin.php.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.