How to set page title based on data from a server connect? (NodeJS)

This is what I want to achieve:

So the page title in the browser should be: watch - [Course Title Here] image Note: 3 is taken from the URL right now and is NOT the course title.

But I can’t get the course title yet because that Server Connect action hasn’t run:

I tried following this https://docs.wappler.io/t/sever-side-rendering-with-nodejs/21650 but I can’t set the meta server action there as I’m already using a server action to check if the user is logged in and has permission.image

How do I set the course title in the page title?

Thanks!

Ya, I think you must use the Server Connect chosen under the Server Side Data, it can’t be any other server connect.

Any reason you can’t add the output you need to the access_check_all server connect?

I suppose I could just do that @mebeingken
Only objections…
It’s a bit messy perhaps? It’s then both a security check to see if people are logged in AND a query to get the course name.

Perhaps also not the best performance wise? I only need to set the title to this on one certain page: /watch

Please tell me if these are non-issues. I’m just making assumptions here, I don’t have enough in-depth knowledge.

I don’t see it as being messy…perhaps look at it as a server connect that performs all necessary prep work (security check and meta tags would be good prep work.) And if you need various layouts to have different actions due to security differences, you can use a Library action for the title query and re-use for efficiency.

If this is a unique page needing this, then maybe you have have a unique layout just for it, and then another layout that does not call the meta query.