Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
adding alt attribute to a banner image (opencart)

On the website we have banners all over but non of them have any alt text.

Below is the code for, any pointers as to how i can solve this issue? I was thinking maybe having the alt as the image name if possible so need to find a way to echo it.

Any other suggestions? I have 8 banners and don't mind manually adding the alt text for each banner if possible

<?php if ($module_title){ ?>
<div class="box-heading"><?php echo $module_title; ?></div>
<?php } ?>
<div class="box rich_banner grid_holder">
<?php foreach($sections as $section){ ?>
<div class="banner_<?php echo $columns; ?>">
<div class="image zoom_image_container"><img class="zoom_image" alt="" src="<?php echo $section['image']; ?>" />
<?php echo $section['description']; ?>
</div>
</div>
<?php } ?>
</div>

would this be the section of variable below?

<?php
class ControllerExtensionModuleCosyoneBanner extends Controller {
    public function index($setting) {


        if(empty($setting['module_title'][$this->config->get('config_language_id')])) {
            $data['module_title'] = false;
        } else if (isset($setting['module_title'][$this->config->get('config_language_id')])) {
            $data['module_title'] = html_entity_decode($setting['module_title'][$this->config->get('config_language_id')], ENT_QUOTES, 'UTF-8');
        }

        $data['columns'] = $setting['columns'];

        if (isset($setting['sections'])) {        
            $data['sections'] = array();

            $section_row = 0;

            foreach($setting['sections'] as $section) {
                $this->load->model('tool/image');

                if (isset($section['block'][$this->config->get('config_language_id')])){
                    $block = html_entity_decode($section['block'][$this->config->get('config_language_id')], ENT_QUOTES, 'UTF-8');
                } else {
                    $block = false;
                }

                if (isset($section['thumb_image'])){
                $image = 'image/' . $section['thumb_image'];
                } else {
                $image = false;
                }


                $section_row++;

                $data['sections'][] = array(
                    'index'   => $section_row,
                    'description'   => $block,
                    'image' => $image
                );
            }

            return $this->load->view('extension/module/cosyone_banner', $data);
        }
    }
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You are able to use the description in your alt, I think for what's available that is the best solution.

<div class="image zoom_image_container"><img class="zoom_image" alt="<?php echo $section['description']; ?>" src="<?php echo $section['image']; ?>" />
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda