Using "card" style on Featured Articles?

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2507
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Using "card" style on Featured Articles?

Post by JAVesey » Tue Sep 19, 2023 1:57 pm

Hi,

Using Cassiopeia on my J4 site. Modules on the homepage have the "card" style, either set manually in, e.g. the "main top" position, or inherited (sidebar right).

The only items not having the "card" style on the homepage are the Featured Articles.

I'm thinking that the homepage would look better and little more "together" if the Featured Articles all had the "card" style individually.

Any ideas as to how to achieve this? CSS code added to user.css maybe?

Many thanks in advance
John V
Cardiff, Wales, UK
Joomla 5.0.1 "live" site on PHP 8.2.9 and MariaDB 10.6.15
Joomla 5.0.1 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9324
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Using "card" style on Featured Articles?

Post by AMurray » Tue Sep 19, 2023 9:37 pm

Isn't "Card" a bootstrap style?
https://www.w3schools.com/bootstrap5/bo ... _cards.php

Is that what you mean? (that the type of look you're wanting)?
Regards - A Murray

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2507
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Using "card" style on Featured Articles?

Post by JAVesey » Wed Sep 20, 2023 5:43 pm

Cheers Andy,

That's the one! How do I use it, though, i.e. apply the .card-header and .card-body to individual articles and, more importantly to me, Featured Articles? Presumably some code in user.css?

Many thanks
John V
Cardiff, Wales, UK
Joomla 5.0.1 "live" site on PHP 8.2.9 and MariaDB 10.6.15
Joomla 5.0.1 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9324
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Using "card" style on Featured Articles?

Post by AMurray » Wed Sep 20, 2023 9:22 pm

I thought bootstrap is already loaded in J4 (?). So you just use the class names in your <div> or <p> etc,. in your articles. I don't know how to apply it to say the featured articles or blog layouts under menu items.

Possibly your idea of user.css is correct.

I might be on the wrong track entirely, but will be interested in others' ideas
Regards - A Murray

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2507
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Using "card" style on Featured Articles?

Post by JAVesey » Thu Sep 21, 2023 6:22 pm

AMurray wrote:
Wed Sep 20, 2023 9:22 pm
I might be on the wrong track entirely, but will be interested in others' ideas
Me too :)

Might have a "play" over the weekend. Thanks for the replies, as always.
John V
Cardiff, Wales, UK
Joomla 5.0.1 "live" site on PHP 8.2.9 and MariaDB 10.6.15
Joomla 5.0.1 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30480
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Using "card" style on Featured Articles?

Post by Per Yngve Berg » Thu Sep 21, 2023 7:13 pm

Override the Featured Articles Layout and add the classes.


Post Reply

Return to “General Questions/New to Joomla! 4.x”