Add author to carousel


Is there any way to add an author to an image carousel? I already added the title, but would like to add the author as well.

This is what I have so far:


Could you post the code that you use to add the title? For the author – Dublin Core Creator – I expect it will be almost exactly the same.

Dear Patrick,

This is the code for adding the title:

<?php echo $this->shortcodes('[carousel showtitles=true sort=added order=d interval=7000 tags=portada]');?>

Can I add a Dublin Core Creator as a shortcode?

thanks in advance

Ah, my bad. I’d forgotten that title was added as an option. You can still add the author by overriding the carousel’s file.

Go to ShortcodeCarousel/views/public and copy carousel.php into the top of your theme’s folder. Then, look for the code like this

            <?php echo link_to_item(
                    item_image('square_thumbnail', array(), 0, $item), 
                    array('class' => 'shortcode-carousel-image'), 'show', $item
            <?php if(isset($configs['carousel']['showTitles']) && $configs['carousel']['showTitles'] ): ?>
                <p class="shortcode-carousel-title">
                <a href="<?php echo record_url($item, 'show'); ?>">
                <?php echo metadata($item, array('Dublin Core', 'Title')); ?>
            <?php endif; ?>

Before the closing </li> you can put in

<?php echo metadata($item, array('Dublin Core', 'Creator'); ?>

and that should do the trick

1 Like

thanks Patrick!
it works!!!

Really your input!