Replies: 3 comments 2 replies
-
I'm not sure why you want that logic in your theme? Why not create a normal module for the conference selection, and then just change the site theme based on the user selection? |
Beta Was this translation helpful? Give feedback.
-
we might be able to access some shared site state from the theme and the modules. I'm looking into that. |
Beta Was this translation helpful? Give feedback.
-
As @mikecasas said, a theme is intended to be a very lightweight component that provides look/feel and layout for a page. It typically should not maintain its own state or connect to a database. One option is that you create a razor component which is a Theme Control ( similar to the Login.razor, Logo.razor, etc.. ) and you include a static reference to the control directly in your theme. The control provides the conference selection functionality. Another option is you would define your theme to have a Pane in the location where the conference selector needs to be displayed. Then you would create a conference selector Module. Then you would use the Oqtane UI to dynamically add the conference selector module to the pane on the page. Then you can go into the Module Settings for that module and specify to Display On All Pages. As far as state management is concerned, I would never recommend using session state. You can use cookies by leveraging the Oqtane JavaScript Interop methods in the framework. You can use Querystring parameters. |
Beta Was this translation helpful? Give feedback.
-
Hello Oqtane community,
Fellow community member MarkDav and I are working on a big project using oqtane as our framework. We have our custom theme setup in it's own Visual Studio solution, and it works fine for generating a header and side navigation for our project as long as what we are displaying is coming from the Oqtane database, but as one can imagine, this won't be sufficient for some implementations. In our case, we want a search bar or dropdown list of conferences at the top that will allow customers to query a conference table in a different database (from oqtane), and when they select the resulting row we can store the id in a cookie or session variable and then use that to display conference name and header image in the template header or in the navigation.
I don't see any way that I can make calls to a different database in my theme, any suggestions? Do I need to setup a model and db connection strings in my theme? Any guidance here would be helpful.
Beta Was this translation helpful? Give feedback.
All reactions