-
Notifications
You must be signed in to change notification settings - Fork 76
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
Create Theme as ValueObject and add theme inheritance #27
Comments
I cann't select what be better: interface ThemeInterface
{
function getName();
function getParentThemeName();
function getAssetsVersion();
} |
One thing to keep in mind here is that some users have dynamic themes, aka they do not hardcode the list of themes. i don't really want to complicate their use case. As such I am not yet sure if there is really a benefit here that warrants the added complexity. |
are you talking about ValueObject or about theme inheritance in whole? |
both .. |
so in other words to convince me .. you will have to present a more complete argument .. maybe the others are easier to convince :) |
Theme inheritance is most often thing. Magento has similar to now fallback mechanism, but in Magento2 will present real theme inheritance http://dimitrigatowski.com/2011/06/19/magento-2-preview/ For example now I'm working with one sport social network. There is two sites: for riding sports (bike, ski) and for commans sports types (hockey, football). Second site will extend theme from first. There is also mobile (light) version, wich will override some layouts from second site. And other case (fabricated): there is SAAS and customers can use own themes. And like in Magento they want use themes inheritance. VO just helps create hierarchy of themes, this is optional. |
ok .. talked to some people ... and it seems there is demand for this feature. can you make a proposal for an implementation? |
as for your question from above .. i tend toward b) as this will likely make the life easier for people with dynamic themes |
I will try to do something with this at weekend |
sorry for delay, haven't yet time to seat and consider how it should be realized :( |
Interested in this too... |
me too |
I'm interested in this too! Anybody started with this? |
Is #68 what you are after? |
This is a feature request. I wonder if there is a good way to do this. Let me try to elaborate with an example: Lets say I have a theme called MyBeautifulDefaultTheme which is used for the site official layout. However, since XMas is coming, I want to create a variant of the theme (perhaps with the red/white theme color etc...). I don't want to (and should not have to) clone the full MyBeautifulDefaultTheme theme and edit it. I can simply created a new theme called MyBeautifulXmasTheme specify that it inherit MyBeautifulDefaultTheme. Now, for every template and asset files that are not present in the new theme Liip should automatically fall back to the parent theme to see if they are there. (I believe with the current system Liip can already loop through the list of all themes to look for files. However, this is not the best approach I believe. The reason is that I can have 10 themes in stock and they are not all related to each other. Without proper ordering of themes (and sometimes it's also impossible to do so) we will have un-intended fallback. |
We have similar situation for our websites (we have multiple websites on platform), each website has two theme |
@oleg-andreyev yup, we are using that solution as well. The only issue is that if you have more than 1 active set of themes, say
Now there will be a problem because we may want to fallback for G to stop at E only and not going any further than that. But with the current solution you must place A,B,C,D,E,F,H,G all into the list thus the fallback may go beyond what is desired. Why do we have 2 active sets of themes? Well a real life example is to serve different customer segments with custom layouts. Another real life example is when you want to do A/B testing on the whole site. For now, we get around this by overriding the ActiveTheme service and set themes upon each request. For example, if we decide to serve theme C then we will set A and C only into the theme list. We are still doing some tests to see how it work with assets however. |
I think finding a solution for A/B testing is certainly interesting. That being said, its certainly a whole new level of complexity that you describe above. So if someone does come up with a solution for what you describe, we should be careful to not make the current solution more complex for people that are happy with the current feature set. |
Imho
Theme
should be not just string but class (VO). And also it will good support inheritance of themes.The text was updated successfully, but these errors were encountered: