[TYPO3-mvc] Getting rid of base wrap inside a controller action?
Braulio J. Solano-Rojas
braulio at solsoft.biz
Sat Oct 30 20:26:09 CEST 2010
Hi!
El 30/10/2010 07:23 a.m., Franz Koch escribió:
> Hey,
>
>>>> I have an action that's called by AJAX and I would like not to have the
>>>> base wrap, just to return a number. I have tried several things like:
> ...
>>>> return number_format($rate, 2, '.', '\'');
>>>>
>>>> But nothing seems to work.
>>>>
>>>> How can I get rid of it inside of the action (without Typoscript)?
>>>> Someone has done it?
> ...
>>> remove it from the layout? use antoher/no layout?
> ...
>> If you mean you have a template set in typo3 and don't want it here
>> because
>> this is an ajax call... I know you said no typoscript but I think using a
>> different page type is the best way to go for ajax. Otherwise the other
>> thing that comes to mind is using content processing hooks (but a
>> different
>> page type is much less hassle).
>
> I'd probably try one of the following (not tested though):
> - make use of the format parameter and pass a argument like json/xml/ajax
> - create a layout file with this file suffix and remove all unneeded
> stuff there
> - also create a template file with according suffix
>
> If the layout will be picked wrongly (not using the format), specify it
> explicitly in your template by <f:layout name="layout.json" />
Thanks Steffen, Christine and Franz for your answers, you're very kind. :-)
@Steffen: I already have no-layout for that action.
@Christine: I already have a different page type number in my setup.txt:
ajax = PAGE
ajax {
typeNum = 1249058000
config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
}
}
fourelements_reservations < ajax
fourelements_reservations {
typeNum = 1287743646
10 < styles.content.get
}
@Franz: I will try to see if one of those works.
I am sorry if I explain my problems badly, english is not my mother
tongue. What I meant is that TYPO3 wraps my AJAX inside this:
<!-- CONTENT ELEMENT, uid:230/list [begin] -->
<div id="c230" class="csc-default">
<!-- Plugin inserted: [begin] -->
<!-- Plugin inserted: [end] -->
</div>
<!-- CONTENT ELEMENT, uid:230/list [end] -->
That's what I want to get rid of.
I know I can do it with Typoscript (but for all the content elements in
the website) doing this:
tt_content.stdWrap.innerWrap >
However I don't want to do that.
Programmatically, the old way of doing what I want to do was not to use
the function tslib_pibase::pi_wrapInBaseClass($content) when returning
content from an extension. I can not see a parallel in extbase to
achieve the same feature.
Best regards,
B.
More information about the TYPO3-project-typo3v4mvc
mailing list