Reusing of Web Blocks

Reusing of Web Blocks

  

Hi everyone,

I am working on a web application. I have developed a social network application. I want to use that social network application ( that consists of web blocks) into another application. But both the applications have different themes and that are conflicting with the look and feel of the consumer application. I have refrenced the web block into my application. One application is using the Liverpool Base theme and the other is using London base theme. Please is there anyone who can help out?? I have meeting with client by tomorrow so its urgent.


Kind regards

hassan

Hassan, you already try with multitenancy?

Hassan,

In my opinion, you should have 3 Applications/modules. 

The first one with the webblocks and without any theme defined.

The second one (the social network)  with the Liverpool base theme and consuming the webblocks from the first one.

The third one (the "new" application) with the London base theme and consuming the webblocks from the first one.


Abílio Matos

Abilio Matos wrote:

Hassan,

In my opinion, you should have 3 Applications/modules. 

The first one with the webblocks and without any theme defined.

The second one (the social network)  with the Liverpool base theme and consuming the webblocks from the first one.

The third one (the "new" application) with the London base theme and consuming the webblocks from the first one.


Abílio Matos

No i have two applications.

Social Network is based on  London Theme

and the application consuming the web blocks from social network using the LiverPool theme.



Hello Hassan,

What exactly is the problem?
Web blocks, by definition, do not use a "layout" (they can), and so, by default, there is no conflict in terms of JavaScript in the pages where they will be used. 

Also, the CSS is applied first, so you can overwrite the style in the consumer application theme.

Generic web blocks (to be used in different applications) should be designed thinking in being theme agnostic, of course.

So, what exactly is the problem you're facing?
It is just a "style problem"? If so you can overwrite the web blocks style in the consumer application applying different style to the same selectors.

Or is anything else?

Cheers.

Hassan wrote:

Abilio Matos wrote:

Hassan,

In my opinion, you should have 3 Applications/modules. 

The first one with the webblocks and without any theme defined.

The second one (the social network)  with the Liverpool base theme and consuming the webblocks from the first one.

The third one (the "new" application) with the London base theme and consuming the webblocks from the first one.


Abílio Matos

No i have two applications.

Social Network is based on  London Theme

and the application consuming the web blocks from social network using the LiverPool theme.



Hassan,


You have 2 application, I don't disagree but your webblocks should be in a non-theme application (a third one like i suggested) and be consumed by both your 2 applications. 

This way there is no conflict betweent the different themes.


Abílio Matos

Hi Abilio,

thanks for the time. Yeah that seems good idea to prevent conflict. I'll let you know if it works.


Kind regards

Hassan wrote:

Abilio Matos wrote:

Hassan,

In my opinion, you should have 3 Applications/modules. 

The first one with the webblocks and without any theme defined.

The second one (the social network)  with the Liverpool base theme and consuming the webblocks from the first one.

The third one (the "new" application) with the London base theme and consuming the webblocks from the first one.


Abílio Matos

No i have two applications.

Social Network is based on  London Theme

and the application consuming the web blocks from social network using the LiverPool theme.



Hassan,


You have 2 application, I don't disagree but your webblocks should be in a non-theme application (a third one like i suggested) and be consumed by both your 2 applications. 

This way there is no conflict betweent the different themes.


Abílio Matos



Hassan and Abilio Matos

As Eduardo Jauch explained web blocks do not create conflicts between style sheets. 

You need to understand the order in which style sheets are applied

  1. AddStylesheetTag
  2. Web block
  3. Root Theme (and other parents)
  4. Current Theme
  5. Screen
  6. Inline

Themes will override the web blocks styles, unless you are using the !important

Creating another application just so it does not have a theme it's completely irrelevant, you just need to understand where are the "conflicts" coming from (if they in fact exist)

Best regards,

PC