[TYPO3] Use page contents for menu ?

Andreas Burg typo3 at andreasburg.de
Fri Aug 1 20:58:41 CEST 2008


Efstathios Papadopoulos schrieb:
> Hello again,
> 
> I have another question that seems to be a little more complicated... 
> I'm sorry to disturb but the typo3 (english) documentation is so poor 
> for newbies... Until someone gets used to how it works, he's lost into 
> the ocean :-/
> 
> 
> I would like to create a menu of subpages, where each menu item will not 
> only be the subpage's title, but also the subpage's content...
> 
> For example, in this webtree:
> 
> central
> |--page_a
> |--page_b
> |--page_c
> ...
> 
> in each page_(a,b,c..) I will add as content a single image file.
> 
> Is there any possible way, to have in "central" page a menu created, so 
> that each menu item will be both the image and the title of the subpage?
> 
> Well I know I can do it manually in the template's Setup, for each 
> subpage, but this way I'll have to add extra lines of TS code every time 
> I add a page_X... Could this be automated, like the normal TMENUs?
> 
> Thanx!
> 
> 
> PS: Lots of thanx to friend Andreas Burg for helping me in my last 
> question :-)
> 
> (So, to avoid bombing the list with disturbing thanx messages, I'll add 
> my thanx to all friends helping, as PSs in the end of my next mail, 
> either a question or an answer :-P)
> 
@Tyler
sorry, I can not follow your instruction (hint)

@Efstathios

it's not easy for a newbie nor for a pro I think (I'm not a pro).

First try to create a simple HMENU/TMENU with a dummy picture as CSS background or IMG-Tag. Make 
shure it works. You should be familiar creating menus first.

Then take a deep look into TSref. You have to use a TMENUITEM property with the capability of 
processing using stdWrap. Then take a deep long look at the function stdWrap in TSref.

The TMENUITEM delivers you the page ID regarding to itself. Pages are stored in the DB-table 
"pages". You should also use phpmyadmin (or the phpmyadmin exention for TYPO3) so you're able to 
take a look into your TYPO3 DB.

Every page has an ID and it's unique. You have to grab the content of the page regarding to this one 
TMENUITEM. BUT watch, the content is stored in another DBtable named "tt_content".

Each content element in this table "tt_content" has a field named "pid" (parent ID). This tells you 
and TYPO3 to which page this content element belongs to. If there are more than one elements on a 
page, there is also a field "sorting" which stands for the elements positioning on the page. 
Assuming your desired picture is the first element on your pages it should be easy just to grab the 
first element. The field "image" delivers you the name of the image.

You see, it's not as simple. Short ->

study order: TSref - HMENU, TMENU, TMENUITEM, stdWrap
DB - table "pages" field "id", table "tt_content" fields "pid" "sorting" "image"

try to grab the first element (your wanted image) of the page regarding to the TMENUITEM and replace 
it with your dummy immage.

Good luck, tell if you solved it, I haven't done it yet.

Andreas






More information about the TYPO3-english mailing list