Masonry Effect without hardcoded styles

Phoca Gallery - image gallery extension
User avatar
jackprince
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Apr 2013, 11:12
Location: Leipzig, Germany

Masonry Effect without hardcoded styles

Post by jackprince »

Hello Jan & Community,

I try to use the masonry effect in a gallery. But I miss the option to style the view myself. Unfortunately PG adds hard coded styles directly to the elements.
pg-msnr-container gets

Code: Select all

position: relative; height: 230px; width: 600px;
and child elements

Code: Select all

position: absolute; top: 0px; left: 0px;
Also I'm not able to find the code which injects "pg-csv-box" style definitions into the body of the document.

I just would like to have an output with different height mosaic/masonry effect without hard coded styles.

I'll appreciate any help to accomplish that.

greetings,

Daniel
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect without hardcoded styles

Post by Jan »

Hi, it is not hardcoded as default, Phoca Gallery does'n set the size for masonry

The only one hardcoded style (css) is following:

Code: Select all

#pg-msnr-container {
	padding: 0;
	margin: 0;
}
or in php gets: margin: 0 auto, in case it is centered.

Masonry effect set the sizes automatically. :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
jackprince
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Apr 2013, 11:12
Location: Leipzig, Germany

Re: Masonry Effect without hardcoded styles

Post by jackprince »

As far as I can see it there are added 'styles' to the element itself in the markup.
Maybe via the javascript file?

I will write a longer post later on to display the problem. Maybe it's a mix of different configurations which trigger this effect.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect without hardcoded styles

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
User avatar
jackprince
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Apr 2013, 11:12
Location: Leipzig, Germany

Re: Masonry Effect without hardcoded styles

Post by jackprince »

Sorry for the late response.

Here is a snippet of the markup I was talking about.

Code: Select all

<div class="pg-cv-box item col-lg-4 masonry-brick" style="position: absolute; top: 0px; left: 100px;">
 <div class="img-thumbnail pg-cv-box-img pg-box1">
  <div class="pg-box2">
   <div class="pg-box3">
    <a><img /></a>
   </div>
   </div>
  <div class="ph-cb"></div>
</div>
As you may see, I already did some template override (added col-lg-4 and img-thumbnail, both classes from bootstrap3).
The style attribute and the class 'masonry-brick' are added via JS as far as I know. Is there a way to get the masonry effect without the hardcoded styling?
User avatar
jackprince
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Apr 2013, 11:12
Location: Leipzig, Germany

Re: Masonry Effect without hardcoded styles

Post by jackprince »

I currently try to get the effect with pure css. With some css and a fallback.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect without hardcoded styles

Post by Jan »

Hi, what you mean with: get the masonry effect without the hardcoded styling"? there is nothing hardcoded, the masonry is added by javascript :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
jackprince
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Apr 2013, 11:12
Location: Leipzig, Germany

Re: Masonry Effect without hardcoded styles

Post by jackprince »

Is it possible to change this from adding styles to the elements , to change/add classes?
I ran into some issues while styling caused by above shown style attribute.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Masonry Effect without hardcoded styles

Post by Jan »

Hi, I think, this you should ask the Masonry developer.

Jan
If you find Phoca extensions useful, please support the project
Post Reply