How one can build a site structure like Pinterest?
I mean each post has it's own height (with is determined by backend programming).
I'm trying to do it, but what I have now is this:
<ul class="thumbnails">
{% for key, values in prodmatrix %}
<li class="span3">
<div class="product-box">
<span class="sale_tag"></span>
<p><img src="{{ STATIC_URL }}{{values.1.0}}" alt="" /></p>
<h4>{{ values.0.0 }}</h4><br/>
<p class="category">{{values.2.0}} {{values.2.1}} {{values.2.2}}</p>
</div>
</li>
{% endfor %}
</ul>
Which don't work really well, as you can see here
Some similar questions might help you:
CSS3 Multiple Columns
Pinterest style layout (Bootstrap 3 + Masonary) final tweeks
How to display a grid with text like Pinterest?
CSS code for pinterest layout style
Related
I'm using Jinga templating language and bootstrap 4 with my Django application. I'm looking to display the following list of application in multiple columns instead of one. How could I split this list into 4 columns?
<div class = "container">
<h2>Available Application List</h2>
<ul>
{% for app in applicationlist %}
<li><input type="checkbox" name="..." > {{ app.report_name }}</li>
{% endfor %}
</ul>
If you're using Bootstrap, check out the equal distribution columns that are available via the col class: https://v4-alpha.getbootstrap.com/layout/grid/#equal-width
Hope that helps!
You should use CSS for this. Try a multi-column layout:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Columns/Using_multi-column_layouts
Other solutions would include using display: flex on the parent <ul>, setting percentage widths on each <li> along with float: left, or using display: inline-block on each <li>.
I am trying to display the image from the file path but it's seeing a different thing entirely, I'm vague of what to do. I am using dropzone. The images are stored in this directory laravel/public/gallery/images. so the url is thus: http://localhost:port/gallery/images. The images are saved in the db successfully but displaying them is an issue. This is the code to display:
<TR><TD>
<DIV class="row">
<DIV class="col-md-12">
<DIV id="gallery-images">
<ul>
#foreach($productVerificationValidation->productDocumentUpload as $productDocument)
<li>
<a href="{{url($productDocument->file_path)}}./.{{$productDocument->file_name}}" target="_blank">
<img src="{{url($productDocument->file_path)}}">
</a>
</li>
#endforeach
</ul>
</DIV>
</DIV>
</DIV>
</TD></TR>
This is the controller to display the view:
public function viewUploadedDocuments($id=null){
$productVerificationValidation = ProductVerificationValidation::findOrFail($id);
return view('product.verification-validation.viewDocuments')->with('productVerificationValidation', $productVerificationValidation);
}
To my surprise when i check the console on Chrome, instead of getting the properties of the images it returns wrong properties as displayed on the screenshot:
but the db record has a different property as displayed on the screenshot:
what wrong am I to make right, Please help out.
Thanks guys, I got it working by appending the file name to it thus:
<DIV class="row">
<DIV class="col-md-12">
<DIV id="gallery-images">
<ul>
#foreach($productVerificationValidation->productDocumentUpload as $productDocument)
<li>
<a href="{{url($productDocument->file_path .'/'. $productDocument->file_name)}}" target="_blank">
<img src="{{ url($productDocument->file_path .'/'. $productDocument->file_name) }}" />
</a>
</li>
#endforeach
</ul>
</DIV>
</DIV>
</DIV>
Trying to make sure that the columns are all floated to the left while not having huge gaps between the rows.
Here's the HTML:
<div class="row hide-for-small">
<div ng-repeat="module in modules">
<div class="medium-6 large-4 columns">
<div class="modBoxContainer">
<div class="modBox">
<div class="modHeading">
<h1><span class="modNumber">{{ module.part }}</span> {{ module.title }}</h1>
</div>
<ul>
<li ng-repeat="section in module.sections">
<a ng-href="#/education/{{ module.url }}/{{section.number}}/01"><strong>Part {{ section.number | number:0 }}: </strong>{{ section.title }}</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
And as for css it's your average columnar layout through foundation or the like. Columns are fine until they're all different height just as in the picture. I have tried applying n-th child to .modBox and .modBoxContainer but a lot of times it won't even recognize the n-th child rule if used with :nth-child(n+smth)...
How could I assign 1 height to the first three columns and different height to the rest of them? I've tried applying height: auto, height: 100%, combined with min-height or just height rules specified.
Sorry, can't recreate much of the code in JSFiddle or such as it's a huge project I'm working on, but suggestions would be nice. But some suggestions would be great to try as I'm running dry on ideas.
Here's the screenshot of the problem:
NOTE: This solution only works for modern browsers (IE9 and up)
For selecting the first three elements, you can do
nth-of-type(-n+3)
Source
http://www.w3schools.com/cssref/sel_nth-of-type.asp
Using a formula (an + b). Description: a represents a cycle size, n is a counter (starts at 0), and b is an offset value.
This is the code I have.
{block:Date}
<section class="metadata">
<ul class="index">
<li>Date Posted: <time datetime="{MonthNumberWithZero}-{DayOfMonthWithZero}-{Year}">{Month} {DayOfMonth}, {Year}</time></li>
{block:ContentSource}
<li>{lang:Source}:<a href="{SourceURL}">{block:NoSourceLogo}{SourceTitle}{/block:NoSourceLogo}
{block:SourceLogo}<img src="{BlackLogoURL}" width="{LogoWidth}"height="{LogoHeight}" alt="{SourceTitle}" />{/block:SourceLogo}</a></li>
{/block:ContentSource}
{block:NoteCount}<li><a class="notecount" href="{Permalink}#notes">{NoteCountWithLabel}</a></li>{/block:NoteCount}
</ul>
</section>
{/block:Date}
And here is my Tumblr theme.
http://lt-colbylovesamanda.tumblr.com/
Is it me or does Tumblr miss that sometimes?
NoteCount / NoteCountWithLabel
The block {block:NoteCount} will only render if post has a note count higher than zero. If the count is zero, the block isn't rendered.
However, its possible to render the string 0 Notes. To achieve this, simply remove the block and use the variable {NoteCountWithLabel}.
If you move the outer blocks <li> will render, and include a note count regardless:
{block:Date}
<section class="metadata">
<ul class="index">
<li>Date Posted: <a href="{Permalink"><time datetime="{MonthNumberWithZero}-
{DayOfMonthWithZero}-{Year}">{Month} {DayOfMonth}, {Year}</time></a></li>
<li><a class="notecount" href="{Permalink}#notes">{NoteCountWithLabel}
</a></li>
</ul>
</section>
{/block:Date}
Ref: http://www.tumblr.com/docs/en/custom_themes#notes
I'm fairly new to expression engine so forgive me if this question comes across pretty obvious I have a slight problem with integrating exp:resso store tag in my temple, for some reason all
the code i apply under exp:resso's {store} tag doesn't appear on my broswer. The code below demonstrates how i have structured my EE tags, please correct me if i'm wrong...
{exp:channel:entries channel="products" limit="6" paginate="bottom"}
{exp:store:product entry_id="1" return="cart"}
<ul class="inventory">
<li class="item2"> {p_productimage}<img class="itemImg" alt="" src="{p_productimage_image}"/>{/p_productimage}
<div class="product-fam1">
<h3>{p_title}</h3>
<a class="viewItem" href="#"><img src="iamnatesmithen.com/fluotics/css/images/viewItem.jpg";</a>
</div>
</li>
</ul>
{/exp:store:product}
{/exp:channel:entries}
ExpressionEngine test site: http://www.iamnatesmithen.com/ExpressionEngine2/index.php/inventory
Current static site: http://iamnatesmithen.com/fluotics/products.html
Looks like you're not passing the product's entry id to {exp:store:product} correctly. Have you tried this? Note {exp:store:product entry_id="{entry_id}"...
{exp:channel:entries channel="products" limit="6" paginate="bottom"}
{exp:store:product entry_id="{entry_id}" return="cart"}
<!-- snip -->
{/exp:store:product}
{/exp:channel:entries}