Hi Daniel,

you could exchange addPageNrParam with generatePageNavigationUrl:

<?php
class addparam_search extends addparam_search_parent
{
    public function getAdditionalParams()
    {
        $sParams = parent::getAdditionalParams();
        return $this->_addSpecialParam( $sParams );
    }
    public function generatePageNavigationUrl()
    {
        $sUrl = parent::generatePageNavigationUrl();
        return $this->_addSpecialParam( $sUrl );
    }
    protected function _addSpecialParam( $sUrl ){
        $sUrl .= "&amp;test=test";
        return ( $sUrl );
    }
}

Then almost only locator links should have the param, almost because also
comparelinks have the param, but I think it's not possible to exclude them
without template changes as the only changeable variable in sort.tpl is
$_additionalParams, which is retrieved by $oView->getAdditionalParams(), and
the same method is used in compare_links.tpl.

Regards,
Frank Zunderer




-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Daniel
Schlichtholz
Gesendet: Freitag, 5. Juli 2013 20:24
An: [email protected]
Betreff: Re: [oxid-dev-general] Adding params to oxlocator

Hi Frank,

when I understand it right, it also adds the params to links to e.g. CMS
pages or in the footer where they mustn't appear.

Best regards,

Daniel Schlichtholz

Am 05.07.2013 18:39, schrieb Frank Zunderer:

> Hi Daniel,
>
> why do you think more modules are needed? The code adds a param to 
> paging, view, sorting and articles per page.
>
> Regards,
> Frank Zunderer
>
> Zunderer IT Beratung
> Waldstr. 22
> 82205 Gilching
>
> 08105-777250
> 0173-8362768
> [email protected]
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Daniel 
> Schlichtholz
> Gesendet: Freitag, 5. Juli 2013 17:10
> An: [email protected]
> Betreff: Re: [oxid-dev-general] Adding params to oxlocator
>
> Hi Frank,
>
> that was my first idea. But when you start to implement it like that, 
> you very soon find out that you need a lot more modules.
> Then I stopped because my thought was: "Just for adding a simple param 
> one needs to create a handful of modules? This is way too complicated!
> There must be a better way. "
> That's why I ask here. My hope is that someone says: "Hey, it's easy - 
> just call method X in class Y and off you go".
> Or if Mr Someone decides to not say anything because it really is not 
> possible in a fast/easy way, I hope that OXID will implement something 
> like that in future releases.
>
> Best regards,
>
> Daniel Schlichtholz
>
> Am 05.07.2013 16:02, schrieb Frank Zunderer:
>
>> Hi Daniel,
>>
>> best practice i don't know, but maybe something like the following 
>> module for search could be useful:
>>
>> <?php
>> class addparam_search extends addparam_search_parent {
>>       public function getAdditionalParams()
>>       {
>>           $sParams = parent::getAdditionalParams();
>>           return $this->_addSpecialParam( $sParams );
>>       }
>>       protected function _addPageNrParam( $sUrl, $iPage, $iLang = null )
>>       {
>>           $sUrl = parent::_addPageNrParam( $sUrl, $iPage, $iLang );
>>           return $this->_addSpecialParam( $sUrl );
>>       }
>>       protected function _addSpecialParam( $sUrl ){
>>           $sUrl .= "&amp;test=test";
>>           return ( $sUrl );
>>       }
>> }
>>
>> Regards,
>> Frank Zunderer
>>
>> Zunderer IT Beratung
>> Waldstr. 22
>> 82205 Gilching
>>
>> 08105-777250
>> 0173-8362768
>> [email protected]
>>
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected]
>> [mailto:[email protected]] Im Auftrag von 
>> Daniel Schlichtholz
>> Gesendet: Freitag, 5. Juli 2013 13:49
>> An: Oxid Dev-List
>> Betreff: [oxid-dev-general] Adding params to oxlocator
>>
>> Hi list,
>>
>> I need to add a param to all actions that are triggered via the 
>> locator-bar on the search result page.
>> But since each sub part (Pagination, View, Products per page and
>> Sorting) does build the link target differently, I do break my ass to 
>> add a param that is reflected in all generated link targets.
>>
>> What is the best practice to do so?
>>
>> --
>> Best regards,
>>
>> Daniel Schlichtholz
>> Zu den Brauckstücken 5
>> 58313 Herdecke
>>
>> _______________________________________________
>> dev-general mailing list
>> [email protected]
>> http://dir.gmane.org/gmane.comp.php.oxid.general
>>
>> _______________________________________________
>> dev-general mailing list
>> [email protected]
>> http://dir.gmane.org/gmane.comp.php.oxid.general
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
>
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to