skounis / mt-countdown

Display a custom block with a Countdown function for Announcements, such as time-limited offers or upcoming releases in a Drupal 8 website. Drupal 8 module
0 stars 1 forks source link

Block is not placed in the region #33

Closed skounis closed 6 years ago

skounis commented 6 years ago

We noticed that even the region for the block, this module exposes, is set, it's markup is always rendered in the same place.

@a4dyakonov could you please check

a4dyakonov commented 6 years ago

@skounis Hi Stavros. We have 2 different types of data: http://joxi.net/KAxn083FM5l8Zm

skounis commented 6 years ago

@a4dyakonov Please check the screen capture that follows

The 2nd count down is a block placed in a region. However it is rendered In a wrong position above the meta tags.

a4dyakonov commented 6 years ago

@skounis Hi Stavros. Tell me, please. Can you move the block to another region? Or is it always displayed in this place? I can't reproduce this issue locally.

skounis commented 6 years ago

@a4dyakonov I placed the block in the sidebar, the block is created but its content is not rendered within the block

a4dyakonov commented 6 years ago

@skounis It is very strange. Ok, I will check the problem.

a4dyakonov commented 6 years ago

@skounis Hi, Stavros. I found the problem. Your frontend developer added "mt-count-down" class to the block and styled this class that it rendered on the top. http://joxi.net/eAOL8PbIx5w4Zr If we will remove this class, the block will be rendered as usual. http://joxi.net/nAynlNOFYPyXMr I think the frontend developer must fix this bug.

skounis commented 6 years ago

@a4dyakonov I will check that. What I notice however is that the markup of this block in not rendered in the proper place. Instead of being within the block it is placed at the very top of the HTML page. CSS can not control where the HTML tags are placed.

a4dyakonov commented 6 years ago

@skounis Yes. It is not CSS. It is JS issue. In our JS code http://joxi.net/V2VD0PWIx5E8Jr I think he should add another CSS class to styling block and HTML template.

skounis commented 6 years ago

I see,

since mt-count-down is used for styling purposes we should fix/change that. We shoud let the mt-count-down class there and add one more which will be used from our code in order to do cover other needs. Like the one where we reposition the element with Javascript.

To sum-up lets do that

mt_countdown_inject.html.twig

add two classes ... mt-count-down-inject mt-count-down ...

https://github.com/skounis/mt-countdown/blob/master/modules/mt-countdown/templates/mt_countdown_inject.html.twig#L28

Use the more specific mt-count-down-inject in order to reposition the markup in our jQuery code

a4dyakonov commented 6 years ago

@skounis I added mt-count-down-inject class into template and js code and moved changes to the master branch.

skounis commented 6 years ago

@a4dyakonov I confirm. thanx