[TYPO3-english] Alternative page rendering using tx_templavoila_pi1->main_record

Christopher Torgalson bedlamhotel at gmail.com
Mon Jan 25 20:32:26 CET 2010


Hi,

On Mon, Jan 25, 2010 at 11:12 AM, Andre Dittmar <typo3 at hotbytes.de> wrote:
> Dear List,
>
> For special pages I want to render only the pure content without any other
> HTML. The result should contain all content elements of the given page.
> I already tried to use a special method of templavoila, but unfortunately it
> doesn't work so far. Perpaps anyone else had tried similiar before, this is
> my alternative page rendering so far.
>
> page.10 >
> page.10 = CONTENT
> page.10 {
>  table = tt_content
>  select {
>    pidInList = this
>    where = hidden=0 AND deleted=0
>    orderBy = sorting
>  }
>  renderObj = USER
>  renderObj {
>    userFunc = tx_templavoila_pi1->main_record
>    ds = 10
>    to = 11
>    table = tt_content
>  }
> }
>
> I only get a empty result. The DS contain only one field with the default
> Typoscript for rendering the content elements:
>
> 10= RECORDS
> 10.source.current = 1
> 10.tables = tt_content
>
> If I add enter something like:
>
> 10 >
> 10 = TEXT
> 10.value = This is my test!
> 10.wrap = <p>|</p>
>
> I get this text as often as I have content elements on this page, so partly
> it seems to work :-) Anyway, there must be somewhere an error. Maybe anybody
> can confirm, that this method is still working and probably somebody has
> used it before? I havn't found any information about this on google, the
> mailinglist or somewhere else... Perpaps somebody as a alternative idea how
> to solve this?
>


It's a little unclear to me what you mean by "pure content without any
other HTML," but if you mean the content HTML only without the <html>,
<head> and <body> tags, this is relatively simple to achieve. If you
make the page accessible with another page type, you can completely
alter the rendering (much like is sometimes done with 'printable'
versions of pages):

noMarkup = PAGE
noMarkup {
    ### Use a non-standard type number in the URL:
    typeNum = 123
        config {
            #### Remove html, head and body tags:
            disableAllHeaderCode = 1
            ### Change mime type; may not be necessary depending on
your application:
            additionalHeaders = Content-type: text/plain
        }
}


See the following mailing list message for a few more details [1].

It's also possible to make RealURL auto-configuration turn the page
type GET parameter into something like "foo.txt" automatically. See
the RealURL manual [2] for details or, for an example implementation
my bh_firtools extension [3], [4].

[1] http://lists.typo3.org/pipermail/typo3-english/2006-May/025832.html
[2] http://typo3.org/documentation/document-library/extension-manuals/realurl/1.7.0/view/1/4/
[3] http://typo3.org/extensions/repository/view/bh_firtools/current/
[4] http://typo3.org/extensions/repository/view/bh_firtools/current/info/class.tx_bhfirtools_realurl.php/

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list