What is J4 Cassiopeia template using instead of meta Viewport shrink-to-fit=no?

Be informed that this forum is not an official support forum for Joomla! 4.0. Any issues regarding Joomla! 4.0 must be reported at https://issues.joomla.org/.

Joomla! 4.0 is still in its Alpha stage. This forum should be used for sharing information about Joomla! 4.0.

Moderator: ooffick

Post Reply
GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 117
Joined: Wed Oct 01, 2014 10:25 am

What is J4 Cassiopeia template using instead of meta Viewport shrink-to-fit=no?

Post by GillianBPP » Fri Feb 08, 2019 5:26 pm

I am testing the J4 Cassiopeia template alongside a template I created from scratch for J3x and Bootstrap 4x.

Unlike the Cassiopeia template, my template does not use cards but grid columns, e.g. col-md, col-sm-6, etc., which are in divs with

Code: Select all

class="row"
and the div rows are in divs with

Code: Select all

class="container-fluid"
I noticed that on my Samsung phone my template - which uses the same J4 PHP and head code at the top of the template index.php - didn't resize responsively but was shrinking to fit instead. When I added this code into the head -

Code: Select all

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- it works fine.

This is ok for now, but I notice on Bootstrap Github that they are planning to drop support for this in v5.

What code is Joomla! 4x using to the Cassiopeia template resize and how can I make it work for columns, too?

Thanks

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 117
Joined: Wed Oct 01, 2014 10:25 am

Re: What is J4 Cassiopeia template using instead of meta Viewport shrink-to-fit=no?

Post by GillianBPP » Tue Feb 12, 2019 1:03 pm

Actually, I found the answer:

This is the PHP section at the top of the file

Code: Select all

$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
Produces this in the actual displayed index.php file

Code: Select all

<meta name="viewport" content="width=device-width, initial-scale=1">
And it works without the shrink-to-fit part.


Post Reply

Return to “Joomla! 4 Related”