Skip to content

Slots in code. #1091

Answered by JuroOravec
HenkWillcock asked this question in Q&A
Apr 5, 2025 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

Hey @HenkWillcock, you can access them from within the get_context_data() via self.input.slots.

E.g. in the example below is how you would render a slot with the same context that's used for rendering the slots:

class MyTable(Component):
    def get_context_data(self, *args, **kwargs):
        footer_slot = self.input.slots["footer"]
        footer_content = footer_slot(self.outer_context, None, None)

Any suggestions on where to put this info to make it more visible?


PS: Note to self, currently the functions for rendering the slots from within the Python are a bit crude - they accept the inputs that we need to pass internally.

But from user perspective, the function interface slot(Contex…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@HenkWillcock
Comment options

@EmilStenstrom
Comment options

@HenkWillcock
Comment options

@EmilStenstrom
Comment options

@JuroOravec
Comment options

Answer selected by JuroOravec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants