[Typo3-dev] Typo3 as Flash CMS

Andreas Borg borg at elevated.to
Fri Aug 27 12:55:46 CEST 2004


Hi all and Ingmar (who is the king)

Ingmar wrote:
>Adding support for other content element types is simple, you just need
>2 lines of TS code and maybe a small PHP function for a new type.

Yeah I manage  to add some more content types (surprisingly enough by poking
around where
it said "add more content here"). So I added to the setup.txt in static
folder of xml content rendering.

# ****************
# CType: multimedia
# ****************

xmlcontent.multimedia = USER
xmlcontent.multimedia.userFunc = tx_xmlcontentrendering_pi1->multimedia

And then I added corresponding function to the
classs.tx_xmlcontentrendering_p1.php.
I also modified the functions to include the default paths.

 function image($content,$conf) {

  $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
  $gifCreator->init();
  $dimensions =
$gifCreator->getImageDimensions('uploads/pics/'.$this->cObj->data['image']);

  return '
   <tt_content uid="'.$this->cObj->data['uid'].'">
    <image src="uploads/pics/'.$this->cObj->data['image'].'"
height="'.$dimensions[1].'" width="'.$dimensions[0].'" />
    <header><![CDATA['.$this->cObj->data['header'].']]></header>
    <bodytext><![CDATA['.$this->cObj->data['bodytext'].']]></bodytext>
   </tt_content>
  ';


 }

 function multimedia($content,$conf) {

  return '
   <tt_content uid="'.$this->cObj->data['uid'].'">
    <multimedia src="uploads/media/'.$this->cObj->data['multimedia'].'"  />
    <header><![CDATA['.$this->cObj->data['header'].']]></header>
    <bodytext><![CDATA['.$this->cObj->data['bodytext'].']]></bodytext>
   </tt_content>
  ';


 }

Ingmar wrote:
>In order to include the abstract field in the generated XML code, you
>would just have to change the ext_typoscript_setup.txt of the
>ingmar_xmlmenu extension from:

Changed it to:

 2.NO.stdWrap.dataWrap =  <option level="2" name="|" id="{field:uid}"
url="index.php?id={field:uid}&amp;type=555" abstract="{field:abstract}"
description="{field:description}" media="{field:media}"

Decided to move away from renaming subnodes to subsubnodes as this is
something flash
can figure out on its own. Hardcoding the typeNum like this isn't ideal of
course, but the content
rendering on 444 seems to come from the bf_xml_for_flash, and not from the
extensions made
to xml_content_rendering. Hence I removed the content rendering from the
xml_menu and kept
it separate (555). At some stage it would be a good idea to merge these
extensions
into one solid. Keeping them separate works for my approach 3 above as flash
already
knows the menu xml and doesnt need it with every page content request.

But how would one do when a menu object itself is part of the page content
of
a subpage? Im thinking there are many usages of the menu  object...

Ingmar wrote:
>> Just configure the media field to accept SWF files and use it for that
>> purpose.

Masi wrote:
>Good idea.
>But you'd have to set the swf-file for every page.

Exactly. In the case of the master menu the swf in the file list of the
advanced header
would come up as a comma separated list in the "media" attribute in the xml.
It would
correspond to the template for that page, ie a small AS class knowing how to
deal with
the content xml. One could also make some default class in main.swf that
knew how
to deal with some default content, which would kick in if no individual
template.swf
was found in that list. Thats fine I think.

(One issue is filepaths which arent included..not a biggy tho)

But, one should also be able to use the menu object as a submenu in a
content
page, and in that case the linked media could be a thumbnail (swf or jpg)
for a
specific menu option. So if one were to use that field for template.swfs and
for
thumbnail.swfs one would need to invent a consistent way of separating them.

Ingo wrote:
> Look at the TCA-configuration of that field with the
> "Tools->Configuration" module in the Backend.

Can I make the config tool editable? Been digging around more...
trying to change it by adding it in the list for media files in
sysext/cms/ext_tables.php
but no luck.

Masi wrote:
> I'm not sure if this
>is a good idea. Perhaps some constants/TS setup may be a bit more
>convenient.

How would that work? Could you think of an example?

Masi wrote:
> > *cough* though I'm interested I never had the time to check out the
> > extension. But... just in case you're explaining these details to
> > Andreas. How about making it into some docs?

Id be happy to type up a doc about it at some stage,
but better yet experiment some more first with the best
way of dealing with menu/temlate/page content xml
and maybe write a tutorial about it.

/a






More information about the TYPO3-dev mailing list