ChrisTERiS
Well-known member
I've found 4 very useful articles for Articles layout but none on how to set the grid to show always 2 articles per row in all pages.
Is it possible?
Thank you
Chris
Is it possible?
Thank you
Chris
It does seem to be the sidebar that's causing the issue. I just removed the sidebar on those pages and it works now. Interesting, I don't understand how the sidebar would cause a conflict like that.Something may conflict in your site. I replaced my code with your code above and works fine:
The only difference in my site is that I don't have sidebar.
Really don't know. But getting in account that Articles page does not have by default sidebar, maybe means something. As for me, is a long time now that I try to have all my pages without sidebar. At least those pages that does not have a categories block.It does seem to be the sidebar that's causing the issue. I just removed the sidebar on those pages and it works now. Interesting, I don't understand how the sidebar would cause a conflict like that.
Absolutely right. Nothing much has been done here from my side. And the first answer after getting this request (on my forum) was a link to @Brogan 's resource.Bassman has just modified it to change the number of articles per row.
Maybe to post an Article on how to have a nice widget for Last Threads when the Node Type is Articles?No worries @BassMan - I was just having fun.
If you like/want, I can add your modification (credited) as an update to the resource.
Wrap the widget code you have to this:but not responsive.
@media (min-width: @xf-responsiveMedium) {
*** your code ***
}
Thank you for your continued help but the main problem is the long text and secondary I prefer title below the photo and other details in footer like in normal listing.Wrap the widget code you have to this:
HTML:@media (min-width: @xf-responsiveMedium) { *** you code *** }
{$article_text|truncate:150:"..."}
In XF you can use{{ snippet($var, 150 }}
.
{{ bb_code($post.message, 'post', $post) }}
{{ snippet(bb_code($post.message, 'post', $post), 150) }}
/* Blog / Directory layout page */
@media (max-width: @xf-responsiveMedium)
{
.p-body-sidebar
{
display: none;
}
}
.p-body-main:not(.p-body-main--withSidebar) .block--previews .block-body {
grid-template-columns: repeat(3, 1fr);
grid-template-areas: "a a" "b_1 b_2" "b_3 b_4";
}
@media (min-width: @xf-responsiveMedium)
{
@__ctaArticleFooter: 40px;
.block.block--articles.block--previews .block-body .message--articlePreview
{
margin-top: 0;
&:nth-of-type(n)
{
grid-area: unset;
& .articlePreview
{
&-main
{
flex-direction: column;
// min-height: 100%;
padding-bottom: @__ctaArticleFooter;
}
&-image
{
width: 100%;
}
&-title
{
font-size: @xf-fontSizeLarger;
}
&-content
{
margin-bottom: -@__ctaArticleFooter;
}
&-footer
{
position: relative;
bottom: @__ctaArticleFooter;
}
&-meta
{
border-top: solid 1px @xf-borderColor;
& .articlePreview-by
{
display: none;
}
}
}
}
}
}
.message--articlePreview .articlePreview-image+.articlePreview-text .bbWrapper:after
{
background: none;
}
/**********/
We use essential cookies to make this site work, and optional cookies to enhance your experience.