Search
Other Articles Anywhere questions
Forum

center columns displayed

Laurent Lacoste's Avatar Laurent Lacoste
Hi,

I'm using Articles Anywhere to display, inside a custom module, the last 3 articles from a specific category with 3 columns.....Works fine.
But, when there are only 2 articles published like this prntscr.com/1tgt7lg , is it possible to center these 2 articles, instead of having them aligned on left ?

Confidential information:
(hidden)


Many thanks
L.
Peter van Westen's Avatar Peter van Westen ADMIN
You can use the if tags and check the total number returned to conditionally output other HTML or classnames.
See: docs3.regularlabs.com/articlesanywhere/g...urther/if-structures
And: docs3.regularlabs.com/articlesanywhere/data-tags/numbers
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
ok

today I have this code, so I need to add more if, then else to display the relevant number of columns?
<p>{articles category="Agendas" ordering="commence-le ASC, title ASC" limit="3"}</p>
<p>{if first}</p>
<div class="cols-3">
	<p>{/if}</p>
	<div class="home-agendas panel">
		<p>[image-main-blog render_class="home-agendas-image"]</p>
		<h3 class="media-heading">[title]</h3>
		<p>[commence-le format="d-m-Y" render_class="home-agendas-date"]</p>
		<p>[readmore text="Voir" class="home-agendas-readmore"]</p>
	</div>
	<p>{if last}</p>
</div>
<p>{/if}</p>
<p>{/articles}</p>
Peter van Westen's Avatar Peter van Westen ADMIN
You could do something like this.
<p>{if first}</p>
<div class="cols-[total]">
<p>{/if}</p>

And add some kind of class that deals with the justify alignments... and possibly add a max width on the item divs.
All down to css.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
OK I will try and I come back to you 😉
thanks again
L.
Laurent Lacoste's Avatar Laurent Lacoste
another point, on mobile view, how is it possible to adjust responsive design?

see here : prntscr.com/1toqpxs
Peter van Westen's Avatar Peter van Westen ADMIN
Sorry, but this has nothing to do with Articles Anywhere.
This is down to whatever template and CSS framework you are using and what CSS classes you use.

For CSS/styling questions I recommend you ask the template developers. Or if your website is using a CSS framework, like Bootstrap, see their documentation and support.
Please post a rating at the Joomla! Extensions Directory
Laurent Lacoste's Avatar Laurent Lacoste
ok understood.
Laurent Lacoste's Avatar Laurent Lacoste
about css, I used this code (from your documentation), but it is not responsive.
<style>
	.cols-3 {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1rem;
	}
</style>
<h2 class="home-agendas-headtitle">TITLE</h2>
<p>{articles category="Agendas" ordering="commence-le ASC, title ASC" limit="3"}</p>
<p>{if first}</p>
<div class="cols-3">
	<p>{/if}</p>
	<div class="home-agendas panel">
		<p>[image-main-blog render_class="home-agendas-image"]</p>
		<h3 class="media-heading">[title]</h3>
		<p>[commence-le format="d-m-Y" render_class="home-agendas-date"]</p>
		<p>[readmore text="Voir" class="home-agendas-readmore"]</p>
	</div>
	<p>{if last}</p>
</div>
<p>{/if}</p>
<p>{/articles}</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="LINK" target="_self" class="home-agendas-btn" dir="ltr">Voir tous les évènements</a></p>
Andrea Malalana's Avatar Andrea Malalana
As mentioned, we do not provide support for CSS. We provide support for our extensions only.

If you need CSS support, you can ask the template developers, or on Stack Overflow.
Laurent Lacoste's Avatar Laurent Lacoste
ok thanks
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription