backdrop-contrib / mini_layouts

Provide blocks which allow positioning content within them in layouts.
GNU General Public License v2.0
7 stars 4 forks source link

Field Blocks - or contexts #13

Closed stpaultim closed 2 years ago

stpaultim commented 3 years ago

Will we be able to use field blocks or other contextual blocks in mini-layouts. If not, is that possible?

docwilmot commented 3 years ago

I was adding context last week, its a bit complex. Got distracted. Will push what I've got so far soon for testing.

philsward commented 2 years ago

@docwilmot looking for this too. Did you get around to getting this pushed?

docwilmot commented 2 years ago

Check out the new branch "contexts", will need some work.

philsward commented 2 years ago

Thanks @docwilmot

I'll see what I can come up with. I had some really weird issues at first, but I'm hoping a cache-clear has fixed them. I'll keep it posted.

philsward commented 2 years ago

Image fields don't seem to pull in through a "node" context. Everything else I've thrown at it (which isn't much) pulls in OK. I'm not sure if it's my setup or if image fields really are a problem.

docwilmot commented 2 years ago

Image fields don't seem to pull in through a "node" context.

Can youdescribe your steps please? Seems to work for me.

philsward commented 2 years ago

@docwilmot curious... I've always had problems wrapping my head around contexts... In this situation, if I use a context for a specific node ID, does it only pull the info from just that node or all nodes that are of the same type? This might be my issue where I'm pointing to a node that doesn't have an image, then viewing a node that does have an image but wasn't added as a context...

If this is how contexts work, I need to get a new issue going for relationships?

philsward commented 2 years ago

@docwilmot I got around to testing and yes, a context only pulls information from the node provided in the context. I realized after seeing how they work, that I never needed this type of granular functionality (I found more flexible methods) so I never needed to wrap my head around the concept of contexts.

Either relationships need to be added or maybe some sort of relationship to an entity type could be accomplished with visibility conditions which kinda seem to act like the relationships in D7?

philsward commented 2 years ago

Back to topic, Context from path does not save for me, regardless of what I enter for the path.

docwilmot commented 2 years ago

OK, hell of a task, but I think I've coaxed Layout to allow contexts and relationships on mini layouts. Test away please.

philsward commented 2 years ago

You're a rockstar 😉

I'll give it a go, hopefully in the next few days.

philsward commented 2 years ago

I had problems with the add context working, until I noticed the admin label was blanked out like it got reset.

After adding a label and saving, the following errors show up twice:

Notice: Undefined index: title in mini_layouts_admin_configure_validate() (line 432 of /modules/dev/mini_layouts/mini_layouts.admin.inc).

Oddly, it says the layout has been created on every save:

image

I realize now, this isn't related to context... if you want a new issue, let me know and I'll get one going.

Regarding the path context, it's looking / working great.

Core just needs to add in some "Selection Rules" to limit which fields are actually exposed through the context. Maybe someday.

docwilmot commented 2 years ago

Note your old mini layouts need to be deleted and cache cleared. I changed some stuff to do with titles.

stpaultim commented 2 years ago

This seems to be working in the current dev version. Closing this issue.