[TYPO3-english] CoolURI, pagepath and ab_downloads (Modern Downloads)

Jan Bednarik info at bednarik.org
Sat Feb 11 09:42:07 CET 2012


Hi Daniel,

basically - one parameter can be translated only into one pagepath.

There are some other options

1) You can play with SQL - select more elements and use CONCAT on them 
to return stuff/like/this

2) You can replace default page path function with your own

3) You can write userfunc for given element:

<part>
	<parameter>yourparam</parameter>
	<userfunc>class->function</userfunc>
</part>

That paramconstraint element is not much of a use. It mean to check 
whether a parameter should be translated.

Regards

Jan


Dne 10.2.2012 22:20, Daniel Lundsgaard Skovenborg napsal(a):
> Hi,
>
> I'm stuck in my attempt to configure CoolURI for ab_downloads.
> I have two aims:
>
> 1. tx_abdownloads_pi1[category_uid] should be translated into a
> pagepath (/page/parent-category/category/).
> Just fetching the category label in a lookindb element is bad because
> it gives some duplicate urls (e.g. when two categories have a
> Documents subcategory).
>
> 2. Download urls should be in the form
> /download-file/parent-category/category/file
> I.e., the standard pagepath should be stripped from the url. I have
> two pages with download modules, but it doesn't matter which of these
> page id's is stored in the cache for file downloads.
>
> And now for the questions:
>
> @1: I cannot define more than one pagepath element, can I? Can achieve
> the same result with a userfunc in uriparts?
>
> @2: I thought I could strip the pagepath using paramconstraints:
> 	<paramconstraints>
> 		<paramconstraint param="tx_abdownloads_pi1[action]">
> 			<type>string</type>
> 			<compare>neq</compare>
> 			<value>getviewclickeddownload</value>
> 		</paramconstraint>
> 	</paramconstraints>
> I'm not sure I understood the paramconstraints element correctly and I
> cannot find any examples (not in the manual either). Is
> paramconstraints even the way to do this? Can someone give an example
> of the use of this element?
> Alternatively, I thought of writing a userfunc returning blank if
> tx_abdownloads_pi1[action] is getviewclickeddownloadcalling or calling
> tx_cooluri->getPageTitle. Any comments on this?
>
> Regards,
> Daniel



More information about the TYPO3-english mailing list