Zum Inhalt springen

Catmenu: News category shortcut + Image/Text

Erstellt am 8. Februar 2013 · 2 Antworten · letzte Antwort am 26. Februar 2013

Tags: Kategorien, tt_news, Frage

danton ·

Hi

Ich nutzte das tt_news Cat-Menü.
Da tut auch soweit.
Allerdings hab ich 2 Probs.

1.: Jede Cat verlinkt auf eine Seite wo weitere Cats sind und NICHT wie es default ist auf die gleiche Seite.
Dazu hab ich in der Cat "News category shortcut" auf eine Seite verlinkt.
Leider passiert hier gar nichts.
Es gibt zwar folgendes TS das bewirkt aber das alle Cats auf diese Seite linken was mir nichts bringt.

plugin.tt_news.catSelectorTargetPid=irgendeineSeitenId

2.: Mir werden keine Cat-Bilder und Beschreibungstexte angezeigt.

Hoffe jemand weiß weiter.

Danke und Gruß Niels

danton ·

Hi

Leider hab ich noch keine Lösung zu 1. Problem. #angry#
Brauche da unbedingt Hilfe. 😉

Das 2. Problem ist gelöst. Hatte vergessen folgende Konstante zu setzen.

Category menu icon mode
[plugin.tt_news.displayCatMenu.catmenuIconMode]
    The tree/ajaxtree mode has some special options for configuring the icons. The option "catmenuIconMode" configures the behaviour of the icons showing left to the category titles. "catmenuIconMode" offers the following options: -1 = display no icons at all, 0 = display the default icon (tt_news_cat.gif), 1 = display image from category record as icon, 2 = display the icon which is configured as "catmenuIconFile" (default: EXT:tt_news/res/arrow.gif)

Ergänzend hierzu gibt es noch folgendes TS für die Größe der Icons.

plugin.tt_news{
  displayCatMenu {
    catmenuIconFile {
      # icon size for "catmenuIconMode" 1 & 2
      width = 18
      height = 16
    }
    catmenuRootIconFile {
      # icon size for "catmenuIconMode" 1 & 2
      width = 18
      height = 16
    }
  }
}

Grüßle Niels

danton ·

Hi

Ich habe das jetzt mit einem FCE und TS gelöst.

Das FCE besteht aus
- 1x TS-ObjectPath - Type "Element"
Typoscript Object Path Name "lib.fce_news_cat_menu"
Hiermit mache ich den Output
- 1x input-Field - Type "Not mapped"
Feldname "fce_news_cat_menu_show_parent"
Hiermit kann der User steuern ob über halb der Kategorieausgabe die Parent-Kategorie auch ausgegeben wird.
- 1x input-Field - Type "Not mapped"
Feldname "fce_news_cat_menu_id"
Hiermit kann der User im BE eine tt_news Category Parent ID eingeben.

lib.fce_news_cat_menu = COA
lib.fce_news_cat_menu {
  10 = COA
  10{
    if.isTrue.field = fce_news_cat_menu_show_parent
    10 = CONTENT	
    10 {
      wrap = <ul class="news_cat_menu parent-cat clearfix">|</ul>
    	table = tt_news_cat
    	select {
    		selectFields = tt_news_cat.title, tt_news_cat.description, tt_news_cat.parent_category, tt_news_cat.shortcut, tt_news_cat.image, tt_news_cat.uid
    		# Der tt_news Sysordner
    		pidInList = {$plugin.tt_news.pid_list}
    		# UID der Kategorie muss gleich des Werts im TV Feld sein
    		andWhere = tt_news_cat.uid = {field:fce_news_cat_menu_id}
    		andWhere.insertData = 1
    	}
     
    	renderObj = COA
    	renderObj {
        10 = COA
        10{
          stdWrap.typolink{
            parameter.field = shortcut
          }
      		10 = TEXT
      		10 {
      			field= title
      			wrap = <div class="title"><h3>|</h3></div>
      		}
       
      		20 = IMAGE
      		20 {
      			wrap = <div class="image">|</div>
      			file.import.field = image
            file.import.wrap = uploads/pics/|
            file.width = 201
      		}
       
      		30 = TEXT
      		30 {
      			field= description
      			wrap = <div class="description"><p>|</p></div>
      			htmlSpecialChars = 1
      		}
        }
        
        # Wrap around each item
        stdWrap{
          outerWrap = <li data-uid="{field:uid}" data-pid="{field:pid}" data-parent_category="{field:parent_category}">|</li>
          outerWrap.insertData = 1
        }
    	}
    }
  }
  
  
  20 < .10	
  20 {
    # Bei 2. Ausgabe keine Bedingung
    if >
    10{
      wrap = <ul class="news_cat_menu cats clearfix">|</ul>
      select.andWhere = tt_news_cat.parent_category = {field:fce_news_cat_menu_id}
      renderObj{
        30 = LOAD_REGISTER
        30 {
          myCounter.data = register:myCounter
          myCounter.stdWrap.wrap = |+1
          myCounter.prioriCalc = 1
        }
        
        # Wrap um jedes Element
        stdWrap{
          outerWrap = <li data-counter="{register:myCounter}" data-uid="{field:uid}" data-pid="{field:pid}" data-parent_category="{field:parent_category}">|</li>
          outerWrap.insertData = 1
          outerWrap.override = <li data-counter="{register:myCounter}" data-uid="{field:uid}" data-pid="{field:pid}" data-parent_category="{field:parent_category}" class="eol">|</li>
          outerWrap.override.if {
            equals.data = register:myCounter
            # jedes 4. Element
            equals.stdWrap.wrap = |%4
            equals.prioriCalc = 1
            value = 0 
          }
        }
      }
    }
  }
}
jQuery(function(j){
  news_cat_menu = j('.fce-news-cat-menu .news_cat_menu').not('.parent-cat');
  news_cat_menu.find('li').hover(
    function(e){
      j(this).addClass('hover');
    }, function(){
      j(this).removeClass('hover');
    }
  );
});

Vielleicht hilft es ja einem

Gruß Niels