[TYPO3-project-formidable] add current record id to link ..
Asbjørn Morell
atmorell at gmail.com
Sat May 19 00:02:00 CEST 2007
Hey Rego
Good post! Thanks to you I got the link working with the uid :)
Does it do any difference if the php code/function is placed in a userobj or
a function in the main script?
Should I create my own sql query if I only wan't to list 1 record. I was
playing around with function: t3lib_extmgm::extPath($this->extKey) .
"pi1/xml/art_single_view.xml", 6); However this seems to fetch everything
and select the uid I pass to the function :/
Best regards.
Asbjørn Morell.
"Manuel Rego Casasnovas" <mrego at igalia.com> wrote in message
news:mailman.235212.1179502652.21067.typo3-project-formidable at lists.netfielders.de...
Hi Asbjørn,
you can use custom tags for this.
For example I use it like the next, in datahandler lister:
<template>
<path>EXT:my_ext/pi1/templates/template.html</path>
<subpart>###LIST###</subpart>
<includexml>EXT:my_ext/pi1/custom_tags.xml</includexml>
</template>
Custom tags file have the next content:
<customtags>
<tag_edit>
<name>link_edit</name>
<value>
<userobj>
<extension>this</extension>
<method>_populateLinkEdit</method>
</userobj>
</value>
</tag_edit>
</customtags>
The function:
function _populateLinkEdit($aParams, &$oForm){
return t3lib_div::locationHeaderUrl(
$this->_oParent->pi_getPageLink(
$GLOBALS["TSFE"]->id,
"",
array(
"do" => singleView,
"uid" => $aParams['row']['uid']
)
)
);
}
The most important here is: $aParams['row']['uid']
And in my template I use the tag {link_edit} where I want to put the
link.
Best regards,
Rego
--
http://www.igalia.com
El vie, 18-05-2007 a las 16:51 +0200, Asbjørn Morell escribió:
> Hi,
>
>
> 1.
> How do I add the current uid to an url edit link? I was trying to do it
> with
> <onclick ...> however I need to init. 2 new xml list forms, and from what
> I
> cold see this->_oParent->oForm->_forceEntryId ... reloads the current xml
> form, and that is not what I am trying to do.
>
> <renderlet:LINK name="mylink" label="singleView">
> <url>
> <userobj>
> <php><![CDATA[
>
> $uid = "" //here I need help finding the uid.
>
> return t3lib_div::locationHeaderUrl(
> $this->_oParent->pi_getPageLink(
> $GLOBALS["TSFE"]->id,
> "",
> array(
> "do" => singleView,
> "uid" => $uid
> )
> )
> );
> ]]></php>
> </userobj>
> </url>
> </renderlet:LINK>
>
> 2.
> When I load a list form like this:
> $this->oSingle->init(
> &$this,
> t3lib_extmgm::extPath($this->extKey) . "pi1/xml/art_single_view.xml",
> 6
> );
> I get all records from the table but id 6 is higlighted . How do I force
> formidable to only load id 6? (for a list)
>
>
> main pi1 file::
> $do = t3lib_div::_GP('do');
> $uid = t3lib_div::_GP('uid');
>
> switch($do) {
> case 'singleView': //singleview
> $this->oSingle = t3lib_div::makeInstance("tx_ameosformidable");
> $this->oSingle->init(
> &$this,
> t3lib_extmgm::extPath($this->extKey) . "pi1/xml/art_single_view.xml",
> );
> $content .= $this->oSingle->render();
> //
> //here comes images from another table ..
> //
> return $this->pi_wrapInBaseClass($content);
>
> break;
> default: //list and form
> $this->oForm = t3lib_div::makeInstance("tx_ameosformidable");
> $this->oForm->init(
> &$this,
> t3lib_extmgm::extPath($this->extKey) . "pi1/xml/art.xml"
> );
> $content = $this->oForm->render();
>
> $this->oList = t3lib_div::makeInstance("tx_ameosformidable");
> $this->oList->init(
> &$this,
> t3lib_extmgm::extPath($this->extKey) . "pi1/xml/art_list.xml"
> );
> $content .= $this->oList->render();
> return $this->pi_wrapInBaseClass($content);
> break;
> }
> }
>
>
> Best regards.
> Asbjørn Morell.
>
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
>
More information about the TYPO3-project-formidable
mailing list