hello Thorsen
I have a problem when I display the image categories on the main page.
for the first four categories the screen is perfect but if I add a fifth categerie the image appears very large, same with the sixth, the seventh etc until height . I made screeshots to understand better
problem when I display the image categories on the main page.
Moderator: Thorsten
problem when I display the image categories on the main page.
You do not have the required permissions to view the files attached to this post.
Re: problem when I display the image categories on the main page.
Hi,
yes, this is how Bootstrap responsiveness works... and you even tried only the desktop mode.
bye
Thorsten
yes, this is how Bootstrap responsiveness works... and you even tried only the desktop mode.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: problem when I display the image categories on the main page.
sorry but what do you call "desktop mode"
Re: problem when I display the image categories on the main page.
Hi,
sorry, desktop means a screen size resolution over 1024px width
bye
Thorsten
sorry, desktop means a screen size resolution over 1024px width
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: problem when I display the image categories on the main page.
I found a solution by modifying the file "categories helper.php".
on the same line I add empty images to always have 4
the lines added are commented with //FR
(this change may not be optimized)
public function renderStartPageCategories(array $categories): string
{
if (count($categories) === 0) {
return '';
}
$decks = '';
$key = 1;
$val = 1; // FR compteur d'image
foreach ($categories as $category) {
$decks .=
'<div class="card mb-4">' .
'<a href="' . $category['url'] . '">' .
'<img class="card-img-top img-fluid" width="400" src="' . $category['image'] . '" alt="' .
$category['name'] . '" />' .
'</a>' .
'<div class="card-body">' .
'<h4 class="card-title text-center">' .
'<a href="' . $category['url'] . '">' . $category['name'] . '</a>' .
'</h4>' .
'<p class="card-text">' . $category['description'] . '</p>' .
'</div>' .
'</div>';
if ($key % 2 === 0) {
$decks .= '<div class="w-100 d-none d-sm-block d-md-none"></div>';
}
if ($key % 3 === 0) {
$decks .= '<div class="w-100 d-none d-md-block d-lg-none"></div>';
}
if ($key % 4 === 0) {
$decks .= '<div class="w-100 d-none d-lg-block d-xl-block"></div>';
}
$key++;
$val++; // FR incremente compteur image
}
$val--; // FR retabli nb images
$sol=(4-($val % 4)); //FR nb images a completer
while ($sol <> 0) {
$decks .=
'<div class="card mb-4">' . //FR
'<div class="card-body">' . //FR
'<h4 class="card-title text-center">' . //FR
'</h4>' . //FR
'</div>' . //FR
'</div>';
$sol--; //FR
}
return $decks;
}
on the same line I add empty images to always have 4
the lines added are commented with //FR
(this change may not be optimized)
public function renderStartPageCategories(array $categories): string
{
if (count($categories) === 0) {
return '';
}
$decks = '';
$key = 1;
$val = 1; // FR compteur d'image
foreach ($categories as $category) {
$decks .=
'<div class="card mb-4">' .
'<a href="' . $category['url'] . '">' .
'<img class="card-img-top img-fluid" width="400" src="' . $category['image'] . '" alt="' .
$category['name'] . '" />' .
'</a>' .
'<div class="card-body">' .
'<h4 class="card-title text-center">' .
'<a href="' . $category['url'] . '">' . $category['name'] . '</a>' .
'</h4>' .
'<p class="card-text">' . $category['description'] . '</p>' .
'</div>' .
'</div>';
if ($key % 2 === 0) {
$decks .= '<div class="w-100 d-none d-sm-block d-md-none"></div>';
}
if ($key % 3 === 0) {
$decks .= '<div class="w-100 d-none d-md-block d-lg-none"></div>';
}
if ($key % 4 === 0) {
$decks .= '<div class="w-100 d-none d-lg-block d-xl-block"></div>';
}
$key++;
$val++; // FR incremente compteur image
}
$val--; // FR retabli nb images
$sol=(4-($val % 4)); //FR nb images a completer
while ($sol <> 0) {
$decks .=
'<div class="card mb-4">' . //FR
'<div class="card-body">' . //FR
'<h4 class="card-title text-center">' . //FR
'</h4>' . //FR
'</div>' . //FR
'</div>';
$sol--; //FR
}
return $decks;
}
Re: problem when I display the image categories on the main page.
Hello blondin62,
I have the same concerns as you and it is not very nice to have a huge category compared to the others.
I found the file in question but it doesn't work. I tried adding the // FR lines or completely replacing the part concerned, but in any case I come across a blank page as soon as I validate the changes.
Can you help me please
Edit: Well, I tried to copy / paste and there, it works very well. Thank you for your code
I have the same concerns as you and it is not very nice to have a huge category compared to the others.
I found the file in question but it doesn't work. I tried adding the // FR lines or completely replacing the part concerned, but in any case I come across a blank page as soon as I validate the changes.
Can you help me please
Edit: Well, I tried to copy / paste and there, it works very well. Thank you for your code
Re: problem when I display the image categories on the main page.
hello
very good
and for // FR; in fact these are the initials of my first name .
I use this system when I modify a script that I did not write, very useful if I have to go back
very good
and for // FR; in fact these are the initials of my first name .
I use this system when I modify a script that I did not write, very useful if I have to go back