简体   繁体   中英

Typo3 6.2 image caption with link

I'm trying to make the image captions to link to the image link on Typo3 6.2.

I already tried this but no lucky:

tt_content.image.20.caption.1.stdWrap.typolink.parameter.field = image_link

I have this typoscript from Bootstrap Package:

...
    singleCaption {
        singleStdWrap {
            wrap {
                override.cObject = COA
                override.cObject {
                    10 = TEXT
                    10 {
                        value = <figure class="image###CLASSES###">|###CAPTION###</figure>
                        override = <figure class="thumbnail###CLASSES###">|###CAPTION###</figure>
                        override {
                            if {
                                value = 1
                                equals.field = imageborder
                            }
                        }                            
                    }
                }
            }
        }
        caption {
            wrap = <caption class="caption###CLASSES###"> | </caption>
            wrap.override = <figcaption class="caption###CLASSES###"> | </figcaption>
        }
    }
 ...

How can I make my captions linkable to the image link? This should be so simple but I can't figure it out how. Thanks for helping!

试试这个,它可能会做到:

tt_content.image.20.caption.1.stdWrap.typolink.parameter.data = file:current:link

another way is to enable linking on captions generally:


Image Captions linked (generally, if no link has been defined, the image source will be taken)

tt_content.image.20.caption.1.stdWrap.typolink < tt_content.image.20.1.imageLinkWrap.typolink

Image Captions linked (only if caption link has been set)

tt_content.image.20.caption.1.stdWrap.typolink.parameter.data = file:current:link

--> thx to Ravi Dhoriya ツ

cheers

Can you try something like:

... .singleCaption.caption.stdWrap.typolink.parameter.field = image_link

As you are "manually" rendering your content with the TS from the bootstrap package, I think you should apply the additional TypoScript there, not in the tt_content TS from css_styled_content.

Simply try to remove the trim = 1 from stdWrap .

tt_content.image.20.caption.1.1.trim >

That means also that you must not have any newlines in your caption.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM