Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme inheritance example using Smarty 3 #1431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mambax7
Copy link
Collaborator

@mambax7 mambax7 commented Nov 24, 2023

A very simple proof of concept for theme inheritance using Smarty 3
If you can make it more sophisticated and impressive, please submit your changes! It will be very much appreciated!

@alain01
Copy link
Contributor

alain01 commented Nov 24, 2023

Hi @mambax7
Could you explain the value "theme_dynamic" ?

@mambax7
Copy link
Collaborator Author

mambax7 commented Nov 24, 2023

@alain01 it's just a Smarty variable that would be assigned dynamically in each theme. Then the images or other elements could be customized.
The slider.tpl is created only once in the Parent theme:

<div class="item active"><img alt="XOOPS" src="<{$theme_dynamic}>/images/slider1.jpg">

With that you don't need to modify it, and it will work in all child themes.

Of course, this was just quick and dirty attempt to show how theme inheritance could be used now in XOOPS, but I hope that the theme experts like yourself will explore it further and come up with some awesome themes

@alain01
Copy link
Contributor

alain01 commented Nov 24, 2023

haaa
I've just tested... and understood ;-)

In your example,
main theme is xbootstrap and we use different sliders in xbootstrap1 and xbootstrap2.
In xbootstrap1 and xbootstrap2, there are just the slider, the others elements are in the main theme.
Nice Idea !

But there is no menu on left side for the xbootstrap1 and xbootstrap2 (default theme)

xbootstrap1
Capture d’écran 2023-11-25 001358

xbootstrap
Capture d’écran 2023-11-25 001417

@mambax7
Copy link
Collaborator Author

mambax7 commented Nov 25, 2023

@alain01 Thanks for testing! Yes, I saw the issue after I posted, but as I said, it was a "proof of concept", hoping that one of our talented theme designers will bring it to the next level.
There is definitely a lot to learn in order to take advantage of this "template inheritance" in Smarty 3!
The "blocks" they are using might be a little bit confusing too.
Anyway, I'm excited about this new feature in XOOPS!

@alain01
Copy link
Contributor

alain01 commented Nov 26, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants