简体   繁体   中英

tt_news template dont show images

I am developing a webpage with typo3 and tt_news, i edited the tt_news_template_v3 so the news appear in the way I want. I edited the TEMPLATE_LIST3 in this way:

<!-- ###TEMPLATE_LIST3### begin
    This is the template for the list of news in the archive or news page or search
-->

###NEWS_CATEGORY_ROOTLINE###
    <!-- ###CONTENT### begin
          This is the part of the template substituted with the list of news:
    -->
        <!-- ###NEWS### begin -->
        <article class="box">
    <span class="news-list-date" style="margin-left:80%">###NEWS_DATE###</span>

        <div class="image-border">
            <a href="#" class="image image-left">

                <!--###LINK_ITEM###-->###NEWS_IMAGE###<!--###LINK_ITEM###-->

            </a>
        </div>
        <h2><!--###LINK_ITEM###-->###NEWS_TITLE###<!--###LINK_ITEM###--></h2>
        <h3 class="subtitulos">###NEWS_SUBHEADER###</h3>


        <p>###NEWS_CONTENT###</p>
        <!--<p>###CATWRAP_B### ###TEXT_CAT### ###NEWS_CATEGORY### ###NEWS_CATEGORY_IMAGE### ###CATWRAP_E###</p>-->
        <p class="button">
        <!--###LINK_ITEM###-->  Ver M&aacute;s  <!--###LINK_ITEM###-->
        </p>
    </article>

    <!-- ###NEWS### end-->
    <!-- ###NEWS_1### begin -->

    <div class="row" style="margin-top:15px; display: inline-block; width:100%">

        <div class="6u">
            <section class="box tbox">
                <h2><!--###LINK_ITEM###-->###NEWS_TITLE###<!--###LINK_ITEM###--></h2>
                <h3 class="subtitulos">###NEWS_SUBHEADER###</h3>
                <div class="image-border">
                    <a href="#" class="image image-full">
                        <!--###LINK_ITEM###-->###NEWS_IMAGE###<!--###LINK_ITEM###-->
                    </a>
                </div>
                <p>###NEWS_CONTENT###</p>
                <!--<p>###CATWRAP_B### ###TEXT_CAT### ###NEWS_CATEGORY### ###NEWS_CATEGORY_IMAGE### ###CATWRAP_E###</p>-->
                <p class="button">
                <!--###LINK_ITEM###-->  Ver M&aacute;s  <!--###LINK_ITEM###-->
                </p>    
            </section>
        </div>
    <!-- ###NEWS_1### end-->
    <!-- ###NEWS_2### begin -->
        <div class="6u">
            <section class="box tbox">
                <h2><!--###LINK_ITEM###-->###NEWS_TITLE###<!--###LINK_ITEM###--></h2>
                <h3 class="subtitulos">###NEWS_SUBHEADER###</h3>
                <div class="image-border">
                            <hr class="cl-right" />

                    ###NEWS_IMAGE###
                </div>
                <p>###NEWS_CONTENT###</p>
                <!--<p>###CATWRAP_B### ###TEXT_CAT### ###NEWS_CATEGORY### ###NEWS_CATEGORY_IMAGE### ###CATWRAP_E###</p>-->
                <p class="button">
                <!--###LINK_ITEM###-->  Ver M&aacute;s  <!--###LINK_ITEM###-->
                </p>    
            </section>
        </div>
    <!-- ###NEWS_2### end-->
<!-- ###CONTENT### end -->
    </div>

this is my typoscript:

###tt_news
plugin.tt_news.pageBrowser { 
  maxPages = 10 
  showPBrowserText = 0 
  showResultCount = 0 
  showFirstLast = 0 
  browseBoxWrap.wrap = ds|end 
  dontLinkActivePage = 1
  pagefloat = right
  showRange = 0
  disabledLinkWrap = <li>|</li>
  inactiveLinkWrap = <li>|</li>
  activeLinkWrap = <li style="margin-right:5px;">|<li>
  LinksWrap = 
  showResultsWrap = |
  showResultsNumbersWrap =<li>|</li>
  browseBoxWrap = <div style="text-align:center">
  browseLinksWrap = |
}
plugin.tt_news.usePiBasePagebrowser = 1





#-----------------------------------# idioma e imagenes tt_news#-----------------------------------
plugin.tt_news {  

  displayList {
    content_stdWrap.crop = 300 | ...

  image.file.maxW = 87
  image.file.maxH = 59 
  image.file.width  = 87c
  image.file.height = 59c
  image.altText.field = imagecaption

  image >  
  image.stdWrap.cObject = IMAGE  
  image.stdWrap.cObject.file = GIFBUILDER  
  image.stdWrap.cObject.file {  
  XY = 87,59  
  10 = IMAGE  
  10 {  
    offset = 0,0  
    file {  
      import=uploads/pics/  
      import.data = field:image  
      import.listNum = 0  
      import.override.field = image  
      maxW = 87  
      maxH = 59  
      width = 87c  
      height = 59c-0  
    }  
  }  
 }     

    }

  _LOCAL_LANG.default {          
    pi_list_browseresults_first = Primera página    
    pi_list_browseresults_last = Última página    
    pi_list_browseresults_page = Página    
    pi_list_browseresults_prev = < Anterior    
    pi_list_browseresults_next = Siguiente >  
  }
}



plugin.tt_news.newsFiles.stdWrap.HTMLparser.tags.img.fixAttrib.width.set = 16
plugin.tt_news.newsFiles.stdWrap.HTMLparser.tags.img.fixAttrib.height.set = 18 

#page.includeCSS {
#file1 = fileadmin/templates/webuax/css/uax.css
#file1.media = screen
#}


plugin.tt_news.enableConfigValidation = 0

## Hide the "no news id given" & "no news in this list
## messages, they might scare people
plugin.tt_news._LOCAL_LANG.es.noNewsIdMsg =  &nbsp
plugin.tt_news._LOCAL_LANG.es.noNewsToListMsg = &nbsp 
##para que coja los 3 layouts de noticias de la portada
plugin.tt_news.alternatingLayouts = 3


plugin.tt_news._LOCAL_LANG.es {
     more = 
 }

plugin.tt_news._LOCAL_LANG.en {
     more = 
 }

but the ###NEWS_IMAGE### dont work, it renders like this:

<img src="" width="" height="" border="0" alt="">

If I use the single view news, its works, rendering this

<img src="uploads/pics/imagenew.png" width="120" height="120" border="0" alt="">

Anybody knows how to solve it?

thanks in advance

I answer my own question:

The problem was in the resizing of the images, so I installed the JB GD Resize extension, and now it works like a charm

I guess image.stdWrap.cObject = IMAGE does not work - or import=uploads/pics/ is wrong. So, why do you want to use GIBUILDER? There is no need to (i guess).

Your first configuration

  image.file.maxW = 87
  image.file.maxH = 59 
  image.file.width  = 87c
  image.file.height = 59c

looks correct - it should work. So just remove the GIFBUILDER -stuff. I would not expect image.stdWrap to work. It depends on the extension, if "image." is a real IMAGE object. Often it is not!

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