Custom Page List | Page List Template | Custom Alt tag
Permalink
Hello,
I've created a custom template for the Page List. I could use a hand with some additional PHP. I need to alter this code so I can have custom alt tags within an image when displaying a thumbnail with a Page List block. Currently C5 fills the alt tag with the the name of the file.
Currently the thumbnail is created using:
I need to replace this with something like:
Or is there a simple code I can use to override the alt tag?
I've created a custom template for the Page List. I could use a hand with some additional PHP. I need to alter this code so I can have custom alt tags within an image when displaying a thumbnail with a Page List block. Currently C5 fills the alt tag with the the name of the file.
Currently the thumbnail is created using:
I need to replace this with something like:
<?php if (is_object($thumbnail)): ?> <div class="ccm-block-page-list-page-entry-thumbnail"> <img src="<?php echo (something here to pull in the thumbnail) ?>" width="<?php echo $img_width ?>" height="<?php echo $img_height ?>" alt=" (something here to display either the image Title or Description)" /> </div>
Or is there a simple code I can use to override the alt tag?
$alt = (image title or image description);
I believe by default, an image's title property will be its filename (this can be changed).
Set the alt attribute using the image's title property.
Set the alt attribute using the image's description property.